Package org.cryptacular.x509
Enum KeyUsageBits
- All Implemented Interfaces:
Serializable
,Comparable<KeyUsageBits>
,java.lang.constant.Constable
Representation of the bit meanings in the
KeyUsage
BIT STRING type defined in section 4.2.1.3 of RFC
2459.- Version:
- $Revision: 2745 $
- Author:
- Middleware Services
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptioncRLSign bit.dataEncipherment bit.decipherOnly bit.digitalSignature bit.encipherOnly bit.keyAgreement bit.keyCertSign bit.keyEncipherment bit.nonRepudiation bit. -
Method Summary
Modifier and TypeMethodDescriptionint
getMask()
boolean
isSet
(byte[] bitString) Determines whether this key usage bit is set in the given key usage bit string.boolean
isSet
(int bitString) Determines whether this key usage bit is set in the given key usage bit string.boolean
isSet
(org.bouncycastle.asn1.x509.KeyUsage keyUsage) Determines whether this key usage bit is set in the given key usage value.static int
usage
(KeyUsageBits... bits) Computes the key usage value from one or more key usage bits.static KeyUsageBits
Returns the enum constant of this type with the specified name.static KeyUsageBits[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DigitalSignature
digitalSignature bit. -
NonRepudiation
nonRepudiation bit. -
KeyEncipherment
keyEncipherment bit. -
DataEncipherment
dataEncipherment bit. -
KeyAgreement
keyAgreement bit. -
KeyCertSign
keyCertSign bit. -
CRLSign
cRLSign bit. -
EncipherOnly
encipherOnly bit. -
DecipherOnly
decipherOnly bit.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getMask
public int getMask()- Returns:
- Bit mask value.
-
isSet
public boolean isSet(org.bouncycastle.asn1.x509.KeyUsage keyUsage) Determines whether this key usage bit is set in the given key usage value.- Parameters:
keyUsage
- BC key usage object.- Returns:
- True if bit is set, false otherwise.
-
isSet
public boolean isSet(byte[] bitString) Determines whether this key usage bit is set in the given key usage bit string.- Parameters:
bitString
- Key usage bit string as a byte array.- Returns:
- True if bit is set, false otherwise.
-
isSet
public boolean isSet(int bitString) Determines whether this key usage bit is set in the given key usage bit string.- Parameters:
bitString
- Key usage bit string as a big endian integer.- Returns:
- True if bit is set, false otherwise.
-
usage
Computes the key usage value from one or more key usage bits.- Parameters:
bits
- One ore more key usage bits.- Returns:
- Key usage bit string as an integer.
-