Package com.unboundid.util.ssl.cert
Class KeyUsageExtension
java.lang.Object
com.unboundid.util.ssl.cert.X509CertificateExtension
com.unboundid.util.ssl.cert.KeyUsageExtension
- All Implemented Interfaces:
Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class KeyUsageExtension
extends X509CertificateExtension
This class provides an implementation of the key usage X.509 certificate
extension as described in
RFC 5280 section 4.2.1.3.
This can be used to determine how the certificate's key is intended to be
used.
The OID for this extension is 2.5.29.15 and the value has the following encoding:
The OID for this extension is 2.5.29.15 and the value has the following encoding:
KeyUsage ::= BIT STRING {
digitalSignature (0),
nonRepudiation (1), -- recent editions of X.509 have
-- renamed this bit to contentCommitment
keyEncipherment (2),
dataEncipherment (3),
keyAgreement (4),
keyCertSign (5),
cRLSign (6),
encipherOnly (7),
decipherOnly (8) }
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the name for this extension.booleanIndicates whether the CRL sign bit is set.booleanIndicates whether the data encipherment bit is set.booleanIndicates whether the decipher only bit is set.booleanIndicates whether the digital signature bit is set.booleanIndicates whether the encipher only bit is set.booleanIndicates whether the key agreement bit is set.booleanIndicates whether the key cert sign bit is set.booleanIndicates whether the key encipherment bit is set.booleanIndicates whether the non-repudiation bit is set.voidtoString(StringBuilder buffer) Appends a string representation of this certificate extension to the provided buffer.Methods inherited from class com.unboundid.util.ssl.cert.X509CertificateExtension
getOID, getValue, isCritical, toString
-
Field Details
-
KEY_USAGE_OID
The OID (2.5.29.15) for key usage extensions.
-
-
Method Details
-
isDigitalSignatureBitSet
Indicates whether the digital signature bit is set. Iftrue, then the key may be used for verifying digital signatures (other than signatures on certificates or CRLs, as those usages are covered by theisKeyCertSignBitSet()andisCRLSignBitSet()methods, respectively).- Returns:
trueif the digital signature bit is set, orfalseif not.
-
isNonRepudiationBitSet
Indicates whether the non-repudiation bit is set. Iftrue, then the key may be used to prevent someone from denying the authenticity of a digital signature generated with the key.- Returns:
trueif the non-repudiation bit is set, orfalseif not.
-
isKeyEnciphermentBitSet
Indicates whether the key encipherment bit is set. Iftrue, then the public key may be used for encrypting other private keys or secret keys (for example, to protect the keys while they are being transported).- Returns:
trueif the key encipherment bit is set, orfalseif not.
-
isDataEnciphermentBitSet
Indicates whether the data encipherment bit is set. Iftrue, then the public key may be used for encrypting arbitrary data without the need for a symmetric cipher.- Returns:
trueif the data encipherment bit is set, orfalseif not.
-
isKeyAgreementBitSet
Indicates whether the key agreement bit is set. Iftrue, then the public key may be used for key agreement processing.- Returns:
trueif the key agreement bit is set, orfalseif not.
-
isKeyCertSignBitSet
Indicates whether the key cert sign bit is set. Iftrue, then the public key may be used for verifying certificate signatures.- Returns:
trueif the CRL sign bit is set, orfalseif not.
-
isCRLSignBitSet
Indicates whether the CRL sign bit is set. Iftrue, then the public key may be used for verifying certificate revocation list (CRL) signatures.- Returns:
trueif the CRL sign bit is set, orfalseif not.
-
isEncipherOnlyBitSet
Indicates whether the encipher only bit is set. Iftrue, and if theisKeyAgreementBitSet()is alsotrue, then the public key may be used only for enciphering data when performing key agreement.- Returns:
trueif the encipher only bit is set, orfalseif not.
-
isDecipherOnlyBitSet
Indicates whether the decipher only bit is set. Iftrue, and if theisKeyAgreementBitSet()is alsotrue, then the public key may be used only for deciphering data when performing key agreement.- Returns:
trueif the decipher only bit is set, orfalseif not.
-
getExtensionName
Retrieves the name for this extension.- Overrides:
getExtensionNamein classX509CertificateExtension- Returns:
- The name for this extension.
-
toString
Appends a string representation of this certificate extension to the provided buffer.- Overrides:
toStringin classX509CertificateExtension- Parameters:
buffer- The buffer to which the information should be appended.
-