com.ibm.security.pkcs7
Class MailListKeyIdentifier

java.lang.Object
  |
  +--com.ibm.security.pkcsutil.PKCSDerObject
        |
        +--com.ibm.security.pkcs7.MailListKeyIdentifier

public final class MailListKeyIdentifier
extends PKCSDerObject
implements RecipientIdentifier, Cloneable

Implements the ASN.1 MailListKeyIdentifier type.

MailListKeyIdentifier ::= SEQUENCE { keyIdentifier OCTET STRING, date GeneralizedTime OPTIONAL, other OtherKeyAttribute OPTIONAL }

The keyIdentifier identifies the key-encryption key that was previously distributed to the sender and the recipient.

The optional date value specifies a single key-encryption key from a set that was previously distributed to the sender and the recipient.

The optional other value contains additional information used by the recipient to locate the keying material used by the sender.

MailListKeyIdentifier objects are immutable; they cannot be changed once created.

See Also:
UserKeyingMaterial

Fields inherited from class com.ibm.security.pkcsutil.PKCSDerObject
provider
 
Constructor Summary
MailListKeyIdentifier(byte[] der)
          Create a MailListKeyIdentifier object with a DER byte array.
MailListKeyIdentifier(byte[] key, Date date, com.ibm.security.pkcs7.AVA attr)
          Create a MailListKeyIdentifier object with the specified values.
MailListKeyIdentifier(byte[] key, Date date, com.ibm.security.pkcs7.AVA attr, String provider)
          Create a MailListKeyIdentifier object with the specified values.
MailListKeyIdentifier(byte[] der, String provider)
          Create a MailListKeyIdentifier object with a DER byte array.
MailListKeyIdentifier(String filename, boolean base64)
          Create a MailListKeyIdentifier with the filename of the DER-encoded or BASE64-encoded object.
MailListKeyIdentifier(String filename, boolean base64, String provider)
          Create a MailListKeyIdentifier with the filename of the DER-encoded or BASE64-encoded object.
 
Method Summary
 Object clone()
          Creates a clone of this MailListKeyIdentifier object.
protected  void decode(com.ibm.security.pkcs7.DerValue encoding)
          Initializes a MailListKeyIdentifier object from a DerValue.
 void encode(OutputStream os)
          Encodes this object to an OutputStream.
 boolean equals(Object other)
          Determines if this MailListKeyIdentifier object is equivalent to the input object.
 Date getDate()
          Returns a copy the date data member of this object.
 byte[] getKeyIdentifier()
          Returns a copy the keyIdentifier data member of this object.
 com.ibm.security.pkcs7.AVA getOtherAttribute()
          Returns a copy the other attribute data member of this object.
 String toString()
          Returns a string representation of this MailListKeyIdentifier object.
 
Methods inherited from class com.ibm.security.pkcsutil.PKCSDerObject
decode, decode, encode, getObjectIdentifier, hashCode, read, readBASE64, write, write, writeBASE64
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MailListKeyIdentifier

public MailListKeyIdentifier(byte[] der)
                      throws IOException
Create a MailListKeyIdentifier object with a DER byte array.
Parameters:
der - a DER byte array encoding a MailListKeyIdentifier object.
Throws:
IOException - on decoding errors.

MailListKeyIdentifier

public MailListKeyIdentifier(byte[] der,
                             String provider)
                      throws IOException
Create a MailListKeyIdentifier object with a DER byte array.
Parameters:
der - a DER byte array encoding a MailListKeyIdentifier object.
provider - the name of the java security provider to use
Throws:
IOException - on decoding errors.

MailListKeyIdentifier

public MailListKeyIdentifier(byte[] key,
                             Date date,
                             com.ibm.security.pkcs7.AVA attr)
Create a MailListKeyIdentifier object with the specified values.
Parameters:
key - the encoded key-encryption key.
date - specifies a single key-encryption key from a previously-distributed set of keys. This may be null.
attr - additional information used by the recipient to locate keying material used by the sender. This may be null.

MailListKeyIdentifier

public MailListKeyIdentifier(byte[] key,
                             Date date,
                             com.ibm.security.pkcs7.AVA attr,
                             String provider)
Create a MailListKeyIdentifier object with the specified values.
Parameters:
key - the encoded key-encryption key.
date - specifies a single key-encryption key from a previously-distributed set of keys. This may be null.
attr - additional information used by the recipient to locate keying material used by the sender. This may be null.
provider - the name of the java security provider to use

MailListKeyIdentifier

public MailListKeyIdentifier(String filename,
                             boolean base64)
                      throws IOException
Create a MailListKeyIdentifier with the filename of the DER-encoded or BASE64-encoded object.
Parameters:
filename - name of the DER-encoded or base64-encoded object
base64 - true if BASE64-encoded, false if DER-encoded
Throws:
IOException - on decoding errors.

MailListKeyIdentifier

public MailListKeyIdentifier(String filename,
                             boolean base64,
                             String provider)
                      throws IOException
Create a MailListKeyIdentifier with the filename of the DER-encoded or BASE64-encoded object.
Parameters:
filename - name of the DER-encoded or base64-encoded object
base64 - true if BASE64-encoded, false if DER-encoded
provider - the name of the java security provider to use
Throws:
IOException - on decoding errors.
Method Detail

encode

public void encode(OutputStream os)
            throws IOException
Encodes this object to an OutputStream.
Overrides:
encode in class PKCSDerObject
Parameters:
os - the OutputStream to write the encoded data to.
Throws:
IOException - on encoding error.

decode

protected void decode(com.ibm.security.pkcs7.DerValue encoding)
               throws IOException
Initializes a MailListKeyIdentifier object from a DerValue. The DER encoding must be in the format specified by the MailListKeyIdentifier ASN.1 notation.
Parameters:
encoding - a DER-encoded MailListKeyIdentifier object.
Throws:
IOException - on parsing error.

equals

public boolean equals(Object other)
Determines if this MailListKeyIdentifier object is equivalent to the input object.
Overrides:
equals in class PKCSDerObject
Parameters:
other - the object to compare this one to.
Returns:
true, if the two objects are equivalent, false otherwise.

getKeyIdentifier

public byte[] getKeyIdentifier()
Returns a copy the keyIdentifier data member of this object.
Returns:
the byte array of the keyIdentifier data member of this object.

getDate

public Date getDate()
Returns a copy the date data member of this object.
Returns:
the date data member of this object.

getOtherAttribute

public com.ibm.security.pkcs7.AVA getOtherAttribute()
                                             throws IOException
Returns a copy the other attribute data member of this object.
Returns:
the attribute data member of this object.
Throws:
IOException - if an attribute copy cannot be made.

toString

public String toString()
Returns a string representation of this MailListKeyIdentifier object.
Overrides:
toString in class PKCSDerObject
Returns:
a string representation of this object.

clone

public Object clone()
Creates a clone of this MailListKeyIdentifier object.
Overrides:
clone in class Object
Returns:
clone of this MailListKeyIdentifier object.