public class KeyAttributes extends V3Extension
KeyAttributes Extension.
The KeyAttributes extension is obsolete, and has been replaced
by the SubjectKeyIdentifier, KeyUsage, and
PrivateKeyUsagePeriod extensions. It is provided here for backward
compatibility with older certificates only.
The KeyAttributes OID is "2.5.29.2".
The ASN.1 definition of the KeyAttributes extension is specified
as follows:
KeyAttributes ::= SEQUENCE {
subjectKeyIdentifier SubjectKeyIdentifier OPTIONAL,
keyUsage KeyUsage OPTIONAL,
privateKeyUsagePeriod PrivateKeyUsagePeriod OPTIONAL }
If the keyIdentifier field is present it identifies the key in this certificate.
See the SubjectKeyIdentifier documentation for details.
If the keyUsage field is present it identifies the key usage for the key in this certificate.
See the KeyUsage documentation for details.
If the privateKeyUsagePeriod field is present it identifies the validity period for the
corresponding private key. See the PrivateKeyUsagePeriod documentation for details.
This class provides several methods for getting (but not setting) the component values of an
KeyAttributes extension object.
| Modifier and Type | Field and Description |
|---|---|
static ObjectID |
oid |
critical| Constructor and Description |
|---|
KeyAttributes()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
KeyUsage |
getKeyUsage()
Returns the
keyUsage value of this KeyAttributes
extension identifying the possible uses for the key contained in this certificate. |
ObjectID |
getObjectID()
Returns the object ID of this
KeyAttributes extension |
PrivateKeyUsagePeriod |
getPrivateKeyUsagePeriod()
Returns the
privateKeyUsagePeriod value of this KeyAttributes
extension identifying validity date range of the corresponding private key. |
SubjectKeyIdentifier |
getSubjectKeyIdentifier()
Returns the
subjectKeyIdentifier value of this KeyAttributes
extension identifying the public key contained in this certificate. |
int |
hashCode()
Returns a hashcode for this identity.
|
void |
init(ASN1Object attr)
Inits this
KeyAttributes implementation with an ASN1Object
representing the value of this extension. |
ASN1Object |
toASN1Object()
Stub function to meet V3Extension criteria.
|
java.lang.String |
toString()
Returns a string that represents the contents of this
KeyAttributes extension. |
getName, isCritical, setCriticalpublic static final ObjectID oid
public KeyAttributes()
The KeyAttributes extension is obsolete and has been replaced
by the SubjectKeyIdentifier, KeyUsage, and
PrivateKeyUsagePeriod extensions.
Generating a new KeyAttributes extension is not supported.
This class is provided for backward compatibility with existing certificates only.
public ObjectID getObjectID()
KeyAttributes extensiongetObjectID in class V3Extensionpublic void init(ASN1Object attr) throws X509ExtensionException
KeyAttributes implementation with an ASN1Object
representing the value of this extension.
The ASN1Object is the extensionValue from ASN.1 type "Extension" representing
the (optional) keyIdentifier, (optional) keyUsage, and
the (optional) privateKeyUsagePeriod values of this extension.
init in class V3Extensionattr - the extensionValue as an ASN1ObjectX509ExtensionException - if the extension could not be parsedpublic ASN1Object toASN1Object()
toASN1Object in class V3Extensionpublic SubjectKeyIdentifier getSubjectKeyIdentifier()
subjectKeyIdentifier value of this KeyAttributes
extension identifying the public key contained in this certificate.
The subjectKeyIdentifier is returned as a SubjectKeyIdentifier object.
Please refer to the SubjectKeyIdentifier description for structure details.
subjectKeyIdentifier value.public KeyUsage getKeyUsage()
keyUsage value of this KeyAttributes
extension identifying the possible uses for the key contained in this certificate.
The keyUsage is returned as a KeyUsage object.
Please refer to the KeyUsage description for structure details.
keyUsage value.public PrivateKeyUsagePeriod getPrivateKeyUsagePeriod()
privateKeyUsagePeriod value of this KeyAttributes
extension identifying validity date range of the corresponding private key.
The privateKeyUsagePeriod is returned as a PrivateKeyUsagePeriod object.
Please refer to the PrivateKeyUsagePeriod description for structure details.
privateKeyUsagePeriod value.public int hashCode()
hashCode in class V3Extensionpublic java.lang.String toString()
KeyAttributes extension.toString in class java.lang.Object