Package org.bouncycastle.asn1.x509
Class KeyUsage
- java.lang.Object
-
- org.bouncycastle.asn1.ASN1Object
-
- org.bouncycastle.asn1.x509.KeyUsage
-
- All Implemented Interfaces:
ASN1Encodable,Encodable
public class KeyUsage extends ASN1Object
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
Fields Modifier and Type Field Description static intcRLSignstatic intdataEnciphermentstatic intdecipherOnlystatic intdigitalSignaturestatic intencipherOnlystatic intkeyAgreementstatic intkeyCertSignstatic intkeyEnciphermentstatic intnonRepudiation
-
Constructor Summary
Constructors Constructor Description KeyUsage(int usage)Basic constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KeyUsagefromExtensions(Extensions extensions)byte[]getBytes()static KeyUsagegetInstance(Object obj)intgetPadBits()booleanhasUsages(int usages)Return true if a given usage bit is set, false otherwise.ASN1PrimitivetoASN1Primitive()Method providing a primitive representation of this object suitable for encoding.StringtoString()Returns a string containing a concise, human-readable description of this object.-
Methods inherited from class org.bouncycastle.asn1.ASN1Object
equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode, toASN1Object
-
-
-
-
Field Detail
-
digitalSignature
public static final int digitalSignature
- See Also:
- Constant Field Values
-
nonRepudiation
public static final int nonRepudiation
- See Also:
- Constant Field Values
-
keyEncipherment
public static final int keyEncipherment
- See Also:
- Constant Field Values
-
dataEncipherment
public static final int dataEncipherment
- See Also:
- Constant Field Values
-
keyAgreement
public static final int keyAgreement
- See Also:
- Constant Field Values
-
keyCertSign
public static final int keyCertSign
- See Also:
- Constant Field Values
-
cRLSign
public static final int cRLSign
- See Also:
- Constant Field Values
-
encipherOnly
public static final int encipherOnly
- See Also:
- Constant Field Values
-
decipherOnly
public static final int decipherOnly
- See Also:
- Constant Field Values
-
-
Method Detail
-
fromExtensions
public static KeyUsage fromExtensions(Extensions extensions)
-
hasUsages
public boolean hasUsages(int usages)
Return true if a given usage bit is set, false otherwise.- Parameters:
usages- combination of usage flags.- Returns:
- true if all bits are set, false otherwise.
-
getBytes
public byte[] getBytes()
-
getPadBits
public int getPadBits()
-
toString
public String toString()
Description copied from class:ObjectReturns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toStringmethod if you intend implementing your owntoStringmethod.
-
toASN1Primitive
public ASN1Primitive toASN1Primitive()
Description copied from class:ASN1ObjectMethod providing a primitive representation of this object suitable for encoding.- Specified by:
toASN1Primitivein interfaceASN1Encodable- Specified by:
toASN1Primitivein classASN1Object- Returns:
- a primitive representation of this object.
-
-