org.bouncycastle.asn1.x509

Class KeyUsage

Implemented Interfaces:
DEREncodable, DERString, DERTags

public class KeyUsage
extends DERBitString

The KeyUsage object.
    id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 }

    KeyUsage ::= BIT STRING {
         digitalSignature        (0),
         nonRepudiation          (1),
         keyEncipherment         (2),
         dataEncipherment        (3),
         keyAgreement            (4),
         keyCertSign             (5),
         cRLSign                 (6),
         encipherOnly            (7),
         decipherOnly            (8) }
 

Field Summary

static int
cRLSign
static int
dataEncipherment
static int
decipherOnly
static int
digitalSignature
static int
encipherOnly
static int
keyAgreement
static int
keyCertSign
static int
keyEncipherment
static int
nonRepudiation

Fields inherited from class org.bouncycastle.asn1.DERBitString

data, padBits

Fields inherited from interface org.bouncycastle.asn1.DERTags

APPLICATION, BIT_STRING, BMP_STRING, BOOLEAN, CONSTRUCTED, ENUMERATED, EXTERNAL, GENERALIZED_TIME, GENERAL_STRING, GRAPHIC_STRING, IA5_STRING, INTEGER, NULL, NUMERIC_STRING, OBJECT_IDENTIFIER, OCTET_STRING, PRINTABLE_STRING, SEQUENCE, SEQUENCE_OF, SET, SET_OF, T61_STRING, TAGGED, UNIVERSAL_STRING, UTC_TIME, UTF8_STRING, VIDEOTEX_STRING, VISIBLE_STRING

Constructor Summary

KeyUsage(int usage)
Basic constructor.
KeyUsage(DERBitString usage)

Method Summary

String
toString()

Methods inherited from class org.bouncycastle.asn1.DERBitString

equals, getBytes, getBytes, getInstance, getInstance, getPadBits, getPadBits, getString, hashCode, intValue

Methods inherited from class org.bouncycastle.asn1.DERObject

equals, hashCode, toASN1Object

Methods inherited from class org.bouncycastle.asn1.ASN1Encodable

equals, getDERObject, getEncoded, hashCode, toASN1Object

Field Details

cRLSign

public static final int cRLSign

Field Value:
2


dataEncipherment

public static final int dataEncipherment

Field Value:
16


decipherOnly

public static final int decipherOnly

Field Value:
32768


digitalSignature

public static final int digitalSignature

Field Value:
128


encipherOnly

public static final int encipherOnly

Field Value:
1


keyAgreement

public static final int keyAgreement

Field Value:
8


keyCertSign

public static final int keyCertSign

Field Value:
4


keyEncipherment

public static final int keyEncipherment

Field Value:
32


nonRepudiation

public static final int nonRepudiation

Field Value:
64

Constructor Details

KeyUsage

public KeyUsage(int usage)
Basic constructor.

Parameters:
usage - - the bitwise OR of the Key Usage flags giving the allowed uses for the key. e.g. (KeyUsage.keyEncipherment | KeyUsage.dataEncipherment)


KeyUsage

public KeyUsage(DERBitString usage)

Method Details

toString

public String toString()