|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.asn1.structures.AttributeValue iaik.smime.attributes.SMIMEEncryptionKeyPreference
public class SMIMEEncryptionKeyPreference
The S/MIMEv3 SMIMEEncryptionKeyPreference attribute.
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);
IssuerAndSerialNumber
,
SubjectKeyID
,
RecipientKeyIdentifier
,
CertificateIdentifier
Field Summary | |
---|---|
static ObjectID |
oid
The attributeType object identifier of this SMIMEEncryptionKeyPreference attribute. |
Constructor Summary | |
---|---|
SMIMEEncryptionKeyPreference()
Empty default constructor. |
|
SMIMEEncryptionKeyPreference(ASN1Object obj)
Creates an SMIMEEncryptionKeyPreference from its ASN.1 representation. |
|
SMIMEEncryptionKeyPreference(CertificateIdentifier encryptionCertID)
Creates an SMIMEEncryptionKeyPreference for the given encryption cert identifier. |
Method Summary | |
---|---|
void |
decode(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. |
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. |
ASN1Object |
toASN1Object()
Returns this SMIMEEncryptionKeyPreference as ASN1Object. |
java.lang.String |
toString()
Returns a string representation of this SMIMEEncryptionKeyPreference. |
Methods inherited from class iaik.asn1.structures.AttributeValue |
---|
getName, multipleAllowed |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ObjectID oid
SMIMEEncryptionKeyPreference
attribute.
The corresponding OID string is "1.2.840.113549.1.9.16.2.11".
Constructor Detail |
---|
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(ASN1Object obj) throws CodingException
obj
- the SMIMEEncryptionKeyPreference as ASN1Object
CodingException
- if the encoding is invalidMethod Detail |
---|
public CertificateIdentifier getEncryptionCertID()
IssuerAndSerialNumber
,
SubjectKeyIdentifier
,
or RecipientKeyIdentifier
public void decode(ASN1Object obj) throws CodingException
SMIMEEncryptionKeyPreference
object for
parsing the internal structure.
obj
- the SMIMEEncryptionKeyPreference as ASN1Object
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 ASN1Object toASN1Object() throws CodingException
CodingException
- if the ASN.1 object cannot be builtpublic ObjectID getAttributeType()
getAttributeType
in class AttributeValue
public java.lang.String toString()
toString
in class AttributeValue
|
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 |