|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.cms.SubjectKeyID
public class SubjectKeyID
This class implements the SubjectKeyIdentifier
type.
The Cryptographic Message Syntax (CMS) (RFC 5652)
uses the X.509 certificate SubjectKeyIdentifier
extension for identifying
a certificate (and thereby an entity and a public key):
SubjectKeyIdentifier ::= OCTET STRING
The SubjectKeyIdentifier
type maybe used for specifying the
signer certificate in the CMS SignerInfo
structure,
the recipient certificate in the CMS RecipientInfo
structure, or the originator in the CMS KeyAgreeRecipientInfo
structure.
SignerInfo
,
RecipientInfo
,
KeyAgreeRecipientInfo
Field Summary |
---|
Fields inherited from interface iaik.cms.KeyIdentifier |
---|
ISSUER_AND_SERIALNUMBER, KEK_IDENTIFIER, ORIGINATOR_PUBLIC_KEY, RECIPIENT_KEY_IDENTIFIER, SUBJECT_KEY_IDENTIFIER |
Constructor Summary | |
---|---|
SubjectKeyID()
Default Constructor. |
|
SubjectKeyID(ASN1Object obj)
Creates a new SubjectKeyID from an ASN1Object. |
|
SubjectKeyID(byte[] keyIdentifier)
Creates a new SubjectKeyID the given
identifier value. |
|
SubjectKeyID(X509Certificate cert)
Creates a new SubjectKeyID from a certificate. |
Method Summary | |
---|---|
void |
decode(ASN1Object obj)
Decodes the given ASN.1 SubjectKeyIdentifier object for parsing
the internal structure. |
boolean |
equals(java.lang.Object obj)
Compares this SubjectKeyID to the specified object. |
byte[] |
getKeyIdentifier()
Returns the keyIdentifier value of this SubjectKeyID. |
int |
getKeyIdType()
Returns the key (certificate) identifier type this class represents. |
java.lang.String |
getKeyIdTypeName()
Returns the key (certificate) identifier type this class represents as string. |
int |
hashCode()
Returns a hashcode for this SubjectKeyIdentifier . |
boolean |
identifiesCert(X509Certificate certificate)
Checks if the given certificate is identified by this SubjectKeyID. |
ASN1Object |
toASN1Object()
Returns this SubjectKeyIdentifier as ASN1Object. |
java.lang.String |
toString()
Returns a string giving some information about this SubjectKeyIdentifier object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SubjectKeyID()
public SubjectKeyID(byte[] keyIdentifier)
SubjectKeyID
the given
identifier value.
keyIdentifier
- the SubjectKeyIdentifier valuepublic SubjectKeyID(X509Certificate cert) throws X509ExtensionException
SubjectKeyID
from a certificate.
The KeyIdentifier value is read from the SubjectKeyIdentifier extension of the supplied certificate. If the certificate does not contain the SubjectKeyIdentifier extension an IllegalArgumetException is thrown indicating that a SubjectKeyIdentifier cannot be used for identfying the certificate within a CMS transaction.
cert
- the certificate this SubjectKeyID object shall be
initialized from
X509ExtensionException
- if the given cert does not contain the
SubjectKeyIdentifier extension, or if the SubjectKeyIdentifier
extension cannot be parsedpublic SubjectKeyID(ASN1Object obj) throws CodingException
SubjectKeyID
from an ASN1Object.
The ASN1Object supplied to this constructor represents an
already exisiting SubjectKeyID
object that may
have been created by calling toASN1Object
.
obj
- the SubjectKeyID
as ASN1Object
CodingException
- if the ASN1Object could not be parsedMethod Detail |
---|
public byte[] getKeyIdentifier()
public void decode(ASN1Object obj) throws CodingException
SubjectKeyIdentifier
object for parsing
the internal structure.
This method internally is called when creating a SubjectKeyID
object from an already existing SubjectKeyIdentifier
object,
supplied as ASN1Object.
decode
in interface ASN1Type
obj
- the SubjectKeyIdentifier as ASN1Object
CodingException
- if the object can not be parsedpublic ASN1Object toASN1Object()
SubjectKeyIdentifier
as ASN1Object.
The ASN1Object returned by this method may be used as parameter value
when creating an SubjectKeyID
object using the
SubjectKeyID(ASN1Object obj)
constructor.
toASN1Object
in interface ASN1Type
SubjectKeyIdentifier
as ASN1Objectpublic int getKeyIdType()
getKeyIdType
in interface KeyIdentifier
public java.lang.String getKeyIdTypeName()
getKeyIdTypeName
in interface KeyIdentifier
public boolean identifiesCert(X509Certificate certificate)
true
if the given cert contains a
SubjectKeyIdentifier extension with the same value as represented by this
SubjectKeyIdentifier object.
identifiesCert
in interface CertificateIdentifier
certificate
- the certificate to be checked of being identified by this
SubjectKeyIdentifier
true
if the given cert contains a SubjectKeyIdentifier
extension with the same value as represented by this SubjectKeyIdentifier
object, false
otherwisepublic boolean equals(java.lang.Object obj)
SubjectKeyID
to the specified object.
equals
in interface KeyIdentifier
equals
in class java.lang.Object
obj
- the object to compare this SubjectKeyID
against.
true
, if the given object is equal to this
SubjectKeyID
,
false
otherwisepublic int hashCode()
SubjectKeyIdentifier
.
hashCode
in interface KeyIdentifier
hashCode
in class java.lang.Object
SubjectKeyIdentifier
public java.lang.String toString()
SubjectKeyIdentifier
object.
toString
in interface KeyIdentifier
toString
in class java.lang.Object
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |