iaik.smime.attributes
Class MSOEEncryptionKeyPreference

java.lang.Object
  extended by iaik.asn1.structures.AttributeValue
      extended by iaik.smime.attributes.MSOEEncryptionKeyPreference
All Implemented Interfaces:
ASN1Type

public class MSOEEncryptionKeyPreference
extends AttributeValue

The MSOEEncryptionKeyPreference attribute.

MSOEEncryptionKeyPreference is a private ("1.3.6.1.4.1.311.16.4") attribute that is required by some versions of Microsoft Outlook (e.g. Express) to recognize the encryption cert in a signed message of a sender using different certs for encryption and signing. The encryption cert can be announced by an IssuerAndSerialNumber:

 MSOEEncryptionKeyPreference ::= IssuerAndSerialNumber
 

When creating a MSOEEncryptionKeyPreference object specify the IssuerAndSerialNumber for the encryption certificate of the sender, e.g.:

 X509Certificate encyrptionCert = ...;
 IssuerAndSerialNumber ias = new IssuerAndSerialNumber(encryptionCert);
 MSOEEncryptionKeyPreference MSOEEncryptionKeyPreference = 
   new MSOEEncryptionKeyPreference(ias);
 

See Also:
IssuerAndSerialNumber

Field Summary
static ObjectID oid
          The attributeType object identifier of this MSOEEncryptionKeyPreference attribute.
 
Constructor Summary
MSOEEncryptionKeyPreference()
          Empty default constructor.
MSOEEncryptionKeyPreference(ASN1Object obj)
          Creates an MSOEEncryptionKeyPreference from its ASN.1 representation.
MSOEEncryptionKeyPreference(IssuerAndSerialNumber encryptionCertID)
          Creates an MSOEEncryptionKeyPreference for the given encryption cert identifier.
 
Method Summary
 void decode(ASN1Object obj)
          Decodes the given ASN.1 MSOEEncryptionKeyPreference object for parsing the internal structure.
 boolean equals(java.lang.Object obj)
          Compares this MSOEEncryptionKeyPreference to the specified object.
 ObjectID getAttributeType()
          Returns the OID identifying the MSOEEncryptionKeyPreference attribute type.
 IssuerAndSerialNumber getEncryptionCertID()
          Returns the the encryption cert id.
 int hashCode()
          Returns a hashcode for this MSOEEncryptionKeyPreference.
 ASN1Object toASN1Object()
          Returns this MSOEEncryptionKeyPreference as ASN1Object.
 java.lang.String toString()
          Returns a string representation of this MSOEEncryptionKeyPreference.
 
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

oid

public static final ObjectID oid
The attributeType object identifier of this MSOEEncryptionKeyPreference attribute. The corresponding OID string is "1.3.6.1.4.1.311.16.4".

Constructor Detail

MSOEEncryptionKeyPreference

public MSOEEncryptionKeyPreference()
Empty default constructor. Required for dynamic object creation. Shall NOT be used by an application.


MSOEEncryptionKeyPreference

public MSOEEncryptionKeyPreference(IssuerAndSerialNumber encryptionCertID)
Creates an MSOEEncryptionKeyPreference for the given encryption cert identifier.

Parameters:
encryptionCertID - the IssuerAndSerialNumber identifying the encryption cert of the sender

MSOEEncryptionKeyPreference

public MSOEEncryptionKeyPreference(ASN1Object obj)
                            throws CodingException
Creates an MSOEEncryptionKeyPreference from its ASN.1 representation.

Parameters:
obj - the MSOEEncryptionKeyPreference as ASN1Object
Throws:
CodingException - if the encoding is invalid
Method Detail

getEncryptionCertID

public IssuerAndSerialNumber getEncryptionCertID()
Returns the the encryption cert id.

Returns:
the IssuerAndSerialNumber identifying the encryption cert of the sender

decode

public void decode(ASN1Object obj)
            throws CodingException
Decodes the given ASN.1 MSOEEncryptionKeyPreference object for parsing the internal structure.

Parameters:
obj - the MSOEEncryptionKeyPreference as ASN1Object
Throws:
CodingException - if the ASN1Object cannot be parsed

toASN1Object

public ASN1Object toASN1Object()
                        throws CodingException
Returns this MSOEEncryptionKeyPreference as ASN1Object.

Returns:
this MSOEEncryptionKeyPreference as ASN1Object
Throws:
CodingException - if the ASN.1 object cannot be built

getAttributeType

public ObjectID getAttributeType()
Returns the OID identifying the MSOEEncryptionKeyPreference attribute type.

Specified by:
getAttributeType in class AttributeValue
Returns:
the OID identifying the MSOEEncryptionKeyPreference attribute type.

equals

public boolean equals(java.lang.Object obj)
Compares this MSOEEncryptionKeyPreference to the specified object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare this MSOEEncryptionKeyPreference against.
Returns:
true, if the given object is equal to this MSOEEncryptionKeyPreference, false otherwise

hashCode

public int hashCode()
Returns a hashcode for this MSOEEncryptionKeyPreference.

Overrides:
hashCode in class java.lang.Object
Returns:
a hashcode for this MSOEEncryptionKeyPreference

toString

public java.lang.String toString()
Returns a string representation of this MSOEEncryptionKeyPreference.

Specified by:
toString in class AttributeValue
Returns:
this MSOEEncryptionKeyPreference as string

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

IAIK-CMS 6.0, (c) 2002 IAIK, (c) 2003, 2023 SIC