public class SMIMEEncryptionKeyPreference
extends iaik.asn1.structures.AttributeValue
S/MIMEv3 (RFC 5751)
specifies the SMIMEEncryptionKeyPreference
attribute to may be included as signed attribute in a SignerInfo
to identify encryption certificate of the sender by
by IssuerAndSerialNumber
, or
SubjectKeyIdentifier
, or
RecipientKeyIdentifier
SMIMEEncryptionKeyPreference ::= CHOICE { issuerAndSerialNumber [0] IssuerAndSerialNumber, receipentKeyId [1] RecipientKeyIdentifier, subjectAltKeyIdentifier [2] SubjectKeyIdentifier } id-aa OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) attributes(2)} id-aa-encrypKeyPref OBJECT IDENTIFIER ::= {id-aa 11}
When creating
a SMIMEEncryptionKeyPreference object specify the identifier
for the encryption certificate of the sender, e.g.:
X509Certificate encyrptionCert = ...; IssuerAndSerialNumber ias = new IssuerAndSerialNumber(encryptionCert); SMIMEEncryptionKeyPreference sMIMEEncryptionKeyPreference = new SMIMEEncryptionKeyPreference(ias);
Modifier and Type | Field and Description |
---|---|
static iaik.asn1.ObjectID |
oid
The attributeType object identifier of this
SMIMEEncryptionKeyPreference attribute. |
Constructor and Description |
---|
SMIMEEncryptionKeyPreference()
Empty default constructor.
|
SMIMEEncryptionKeyPreference(iaik.asn1.ASN1Object obj)
Creates an SMIMEEncryptionKeyPreference from its ASN.1 representation.
|
SMIMEEncryptionKeyPreference(CertificateIdentifier encryptionCertID)
Creates an SMIMEEncryptionKeyPreference for the given
encryption cert identifier.
|
Modifier and Type | Method and Description |
---|---|
void |
decode(iaik.asn1.ASN1Object obj)
Decodes the given ASN.1
SMIMEEncryptionKeyPreference object for
parsing the internal structure. |
boolean |
equals(java.lang.Object obj)
Compares this
SMIMEEncryptionKeyPreference to the specified object. |
iaik.asn1.ObjectID |
getAttributeType()
Returns the OID identifying the SMIMEEncryptionKeyPreference attribute type.
|
CertificateIdentifier |
getEncryptionCertID()
Returns the the encryption cert id.
|
int |
hashCode()
Returns a hashcode for this MSOEEncryptionKeyPreference.
|
iaik.asn1.ASN1Object |
toASN1Object()
Returns this SMIMEEncryptionKeyPreference as ASN1Object.
|
java.lang.String |
toString()
Returns a string representation of this SMIMEEncryptionKeyPreference.
|
public static final iaik.asn1.ObjectID oid
SMIMEEncryptionKeyPreference
attribute.
The corresponding OID string is "1.2.840.113549.1.9.16.2.11".public SMIMEEncryptionKeyPreference()
public SMIMEEncryptionKeyPreference(CertificateIdentifier encryptionCertID)
encryptionCertID
- the certificate identifier identifying the
encryption cert of the sender, either by IssuerAndSerialNumber
, SubjectKeyIdentifier
,
or RecipientKeyIdentifier
public SMIMEEncryptionKeyPreference(iaik.asn1.ASN1Object obj) throws iaik.asn1.CodingException
obj
- the SMIMEEncryptionKeyPreference as ASN1Objectiaik.asn1.CodingException
- if the encoding is invalidpublic CertificateIdentifier getEncryptionCertID()
IssuerAndSerialNumber
,
SubjectKeyIdentifier
,
or RecipientKeyIdentifier
public void decode(iaik.asn1.ASN1Object obj) throws iaik.asn1.CodingException
SMIMEEncryptionKeyPreference
object for
parsing the internal structure.obj
- the SMIMEEncryptionKeyPreference as ASN1Objectiaik.asn1.CodingException
- if the encoding is invalidpublic boolean equals(java.lang.Object obj)
SMIMEEncryptionKeyPreference
to the specified object.equals
in class java.lang.Object
obj
- the object to compare this SMIMEEncryptionKeyPreference
against.true
, if the given object is equal to this
SMIMEEncryptionKeyPreference
,
false
otherwisepublic int hashCode()
hashCode
in class java.lang.Object
public iaik.asn1.ASN1Object toASN1Object() throws iaik.asn1.CodingException
iaik.asn1.CodingException
- if the ASN.1 object cannot be builtpublic iaik.asn1.ObjectID getAttributeType()
getAttributeType
in class iaik.asn1.structures.AttributeValue
public java.lang.String toString()
toString
in class iaik.asn1.structures.AttributeValue