|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.cms.RecipientKeyIdentifier
public class RecipientKeyIdentifier
The CMS type RecipientKeyIdentifier.
The RecipientKeyIdentifier type may be used in a KeyAgreeRecipientInfo
for identifying
the public key agreement certificate of the recipient by SubjectKeyIdentifier
and optional date (for
identifiying which of the previously distributed UKMs was used by
the sender) and optional other key attribute (see
RFC 5652):
RecipientKeyIdentifier ::= SEQUENCE { subjectKeyIdentifier SubjectKEyIdentifier, date GeneralizedTime OPTIONAL, other OtherKeyAttribute OPTIONAL } SubjectKeyIdentifier ::= OCTET_STRINGFor interoperability reasons it is recommended NOT to use OtherKeyAttribute.
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 | |
---|---|
RecipientKeyIdentifier()
Default Constructor. |
|
RecipientKeyIdentifier(ASN1Object obj)
Creates a RecipientKeyIdentifier from an ASN1Object. |
|
RecipientKeyIdentifier(SubjectKeyID subjectKeyIdentifier)
Creates a RecipientKeyIdentifier from the given SubjectkeyIdentifier. |
|
RecipientKeyIdentifier(X509Certificate recipientCertificate)
Creates a RecipientKeyIdentifier from the given recipient certificate. |
Method Summary | |
---|---|
void |
decode(ASN1Object obj)
Decodes the RecipientKeyIdentifier from the given ASN1Object. |
boolean |
equals(java.lang.Object obj)
Compares this RecipientKeyIdentifier to the specified object. |
java.util.Date |
getDate()
Gets the optional Date value. |
int |
getKeyIdType()
Returns the key identifier type this class represents. |
java.lang.String |
getKeyIdTypeName()
Returns the key (certificate) identifier type this class represents as string. |
OtherKeyAttribute |
getOtherKeyAttribute()
Gets the optional OtherKeyAttribute component value. |
SubjectKeyID |
getSubjectKeyIdentifier()
Gets the SubjectKeyIdentifier. |
boolean |
hasDate(java.util.Date date)
Checks if this RecipientKeyIdentifier holds the given Date. |
int |
hashCode()
Returns a hashcode for this RecipientKeyIdentifier . |
boolean |
hasOtherKeyAttribute(OtherKeyAttribute otherKeyAttribute)
Checks if this RecipientKeyIdentifier holds the given OtherKeyAttribute. |
boolean |
hasSubjectKeyIdentifier(SubjectKeyID subjectKeyIdentifier)
Checks if this RecipientKeyIdentifier holds the given SubjectKeyIdentifier. |
boolean |
identifiesCert(X509Certificate cert)
Checks if the given certificate is identified by this RecipientKeyIdentifier. |
void |
setDate(java.util.Date date)
Sets the optional Date component. |
void |
setOtherKeyAttribute(OtherKeyAttribute other)
Sets the optional OtherKeyAttribute component. |
ASN1Object |
toASN1Object()
Returns this RecipientKeyIdentifier as ASN1Object. |
java.lang.String |
toString()
Returns a String representation of this RecipientKeyIdentifier. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RecipientKeyIdentifier()
public RecipientKeyIdentifier(X509Certificate recipientCertificate) throws X509ExtensionException
recipientCertificate
- the recipient certificate from which to get the
SubjectKeyIdentifier
X509ExtensionException
- if the given cert does not contain the
SubjectKeyIdentifier extension, or if the SubjectKeyIdentifier
extension cannot be parsedpublic RecipientKeyIdentifier(SubjectKeyID subjectKeyIdentifier)
subjectKeyIdentifier
- the SubjectKeyIdentifierpublic RecipientKeyIdentifier(ASN1Object obj) throws CodingException
obj
- the RecipientKeyIdentifier as ASN1Object
CodingException
- if the ASN1Object cannot be decoded or
is invalid structuredMethod Detail |
---|
public void setDate(java.util.Date date)
date
- the Date optionally identifying which of the previously
distributed UKMs was used by the senderpublic void setOtherKeyAttribute(OtherKeyAttribute other)
other
- additional information for identifying the keypublic java.util.Date getDate()
public OtherKeyAttribute getOtherKeyAttribute()
public SubjectKeyID getSubjectKeyIdentifier()
public void decode(ASN1Object obj) throws CodingException
decode
in interface ASN1Type
obj
- the RecipientKeyIdentifier as ASN1Object
CodingException
- if the ASN1Object cannot be decoded or
is invalid structuredpublic ASN1Object toASN1Object()
toASN1Object
in interface ASN1Type
public boolean hasSubjectKeyIdentifier(SubjectKeyID subjectKeyIdentifier)
subjectKeyIdentifier
- the value of the SubjectKeyIdentifier to compare to
true
if the SubjectKeyIdentifier value of this RecipientKeyIdentifier is
equal to the supplied SubjectKeyIdentifer value, false
otherwisepublic boolean hasDate(java.util.Date date)
true
if the Date component of this RecipientKeyIdentifier is
equal to the supplied Date, false
otherwisepublic boolean hasOtherKeyAttribute(OtherKeyAttribute otherKeyAttribute)
true
if the OtherKeyAttribute component of this
RecipientKeyIdentifier is equal to the supplied OtherKeyAttribute,
false
otherwisepublic boolean equals(java.lang.Object obj)
RecipientKeyIdentifier
to the specified object.
equals
in interface KeyIdentifier
equals
in class java.lang.Object
obj
- the object to compare this RecipientKeyIdentifier
against.
true
, if the given object is equal to this
RecipientKeyIdentifier
,
false
otherwisepublic int hashCode()
RecipientKeyIdentifier
.
hashCode
in interface KeyIdentifier
hashCode
in class java.lang.Object
RecipientKeyIdentifier
public boolean identifiesCert(X509Certificate cert)
This method implements the CertificateIdentifier
interface.
Attention! This method only can check the subjectKeyIdentifier
component of being equal to the SubjectKeyIdentifier of the given
certificate. If you want to check date and otherKeyAttribute you
may use method equals
for comparing this
RecipientIdentifier against some other RecipientIdentifier.
identifiesCert
in interface CertificateIdentifier
cert
- the certificate to be checked of being identified
by this CertificateIdentifier
true
if the given certificate is identified by this
CertificateIdentifier, false
otherwisepublic int getKeyIdType()
getKeyIdType
in interface KeyIdentifier
public java.lang.String getKeyIdTypeName()
getKeyIdTypeName
in interface KeyIdentifier
public java.lang.String toString()
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 |