public class KeyUsage extends ASN1Object
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) }
Modifier and Type | Field and Description |
---|---|
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 |
Constructor and Description |
---|
KeyUsage(int usage)
Basic constructor.
|
Modifier and Type | Method and Description |
---|---|
static KeyUsage |
fromExtensions(Extensions extensions) |
byte[] |
getBytes() |
static KeyUsage |
getInstance(java.lang.Object obj) |
int |
getPadBits() |
boolean |
hasUsages(int usages)
Return true if a given usage bit is set, false otherwise.
|
ASN1Primitive |
toASN1Primitive()
Method providing a primitive representation of this object suitable for encoding.
|
java.lang.String |
toString() |
encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode
public static final int digitalSignature
public static final int nonRepudiation
public static final int keyEncipherment
public static final int dataEncipherment
public static final int keyAgreement
public static final int keyCertSign
public static final int cRLSign
public static final int encipherOnly
public static final int decipherOnly
public KeyUsage(int usage)
usage
- - the bitwise OR of the Key Usage flags giving the
allowed uses for the key.
e.g. (KeyUsage.keyEncipherment | KeyUsage.dataEncipherment)public static KeyUsage getInstance(java.lang.Object obj)
public static KeyUsage fromExtensions(Extensions extensions)
public boolean hasUsages(int usages)
usages
- combination of usage flags.public byte[] getBytes()
public int getPadBits()
public java.lang.String toString()
toString
in class java.lang.Object
public ASN1Primitive toASN1Primitive()
ASN1Object
toASN1Primitive
in interface ASN1Encodable
toASN1Primitive
in class ASN1Object