public class SignerRecipientIdentifier extends java.lang.Object implements CertificateIdentifier
SignerIdentifier (used for identifying the signer certificate of a SignerInfo) and RecipientIdentifier (used for identifying the recipient certificate of a KeyTransRecipientInfo) have the same ASN.1 syntax:
SignerIdentifier ::= CHOICE {
issuerAndSerialNumber IssuerAndSerialNumber,
subjectKeyIdentifier [0] SubjectKeyIdentifier }
respectively:
RecipientIdentifier ::= CHOICE {
issuerAndSerialNumber IssuerAndSerialNumber,
subjectKeyIdentifier [0] SubjectKeyIdentifier }
This class may represent a SignerIdentifier or a RecipientIdentifier, depending
if used in a SignerInfo or in a KeyTransRecipientInfo.ISSUER_AND_SERIALNUMBER, KEK_IDENTIFIER, ORIGINATOR_PUBLIC_KEY, RECIPIENT_KEY_IDENTIFIER, SUBJECT_KEY_IDENTIFIER| Constructor and Description |
|---|
SignerRecipientIdentifier(ASN1Object obj)
Creates a SignerRecipientIdentifier from an ASN1Object.
|
SignerRecipientIdentifier(CertificateIdentifier certificateIdentifier)
Creates a SignerRecipientIdentifier from the given IssuerAndSerialNumber
or SubjectKeyID.
|
| Modifier and Type | Method and Description |
|---|---|
void |
decode(ASN1Object obj)
Decodes the SignerRecipientIdentifier from the given ASN1Object.
|
boolean |
equals(java.lang.Object obj)
Compares this
SignerRecipientIdentifier to the specified object. |
CertificateIdentifier |
getCertificateIdentifier()
Gets the CertificateIdentifier this SignerRecipientIdentifier represents.
|
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.
|
int |
hashCode()
Returns a hashcode for this
SignerRecipientIdentifier. |
boolean |
identifiesCert(X509Certificate cert)
Checks if the given certificate is identified by this CertificateIdentifier.
|
ASN1Object |
toASN1Object()
Returns this SignerRecipientIdentifier as ASN1Object.
|
java.lang.String |
toString()
Returns a String representation of this SignerRecipientKeyIdentifier.
|
public SignerRecipientIdentifier(CertificateIdentifier certificateIdentifier)
certificateIdentifier - the IssuerAndSerialNumber or SubjectKeyID to
be used for identifying the certificateif - the supplied certificateIdentifier is not an IssuerAndSerialNumber
or SubjecKeyIdentifierpublic SignerRecipientIdentifier(ASN1Object obj) throws CodingException
obj - the SignerRecipientIdentifier as ASN1ObjectCodingException - if the ASN1Object cannot be decoded or
is invalid structuredpublic CertificateIdentifier getCertificateIdentifier()
public boolean identifiesCert(X509Certificate cert)
identifiesCert in interface CertificateIdentifiercert - the certificate to be checked of being identified
by this CertificateIdentifiertrue if the given certificate is identified by this
CertificateIdentifier, false
otherwisepublic void decode(ASN1Object obj) throws CodingException
decode in interface ASN1Typeobj - the SignerRecipientIdentifier as ASN1ObjectCodingException - if the ASN1Object cannot be decoded or
is invalid structuredpublic ASN1Object toASN1Object()
toASN1Object in interface ASN1TypeCodingException - if an Encoding error occurspublic boolean equals(java.lang.Object obj)
SignerRecipientIdentifier to the specified object.equals in interface KeyIdentifierequals in class java.lang.Objectobj - the object to compare this SignerRecipientIdentifier
against.true, if the given object is equal to this
SignerRecipientIdentifier,
false otherwisepublic int hashCode()
SignerRecipientIdentifier.hashCode in interface KeyIdentifierhashCode in class java.lang.ObjectSignerRecipientIdentifierpublic int getKeyIdType()
getKeyIdType in interface KeyIdentifierpublic java.lang.String getKeyIdTypeName()
getKeyIdTypeName in interface KeyIdentifierpublic java.lang.String toString()
toString in interface KeyIdentifiertoString in class java.lang.Object