com.ibm.security.smime
Class SMIMEReceiver

java.lang.Object
  |
  +--com.ibm.security.smime.SMIMEReceiver

public final class SMIMEReceiver
extends Object
implements Cloneable

Receives a S/MIME message from a sender and provides methods to retrieve the stored PKCS #7 ContentInfo or PKCS #10 CertificationRequest object within the S/MIME message. Construct this object with the file name containing the S/MIME message or with a SMIMEMessage object.

This definition reflects the S/MIME Version 2 Message Specification RFC 2311 specifications dated March 1998.


Constructor Summary
SMIMEReceiver(byte[] message)
          Create a SMIMEReceiver object with a byte array of a SMIMEMessage.
SMIMEReceiver(byte[] message, String provider)
          Create a SMIMEReceiver object with a byte array of a SMIMEMessage.
SMIMEReceiver(InputStream in)
          Create a SMIMEReceiver object with an InputStream of a SMIMEMessage.
SMIMEReceiver(InputStream in, String provider)
          Create a SMIMEReceiver object with an InputStream of a SMIMEMessage.
SMIMEReceiver(SMIMEMessage message)
          Create a SMIMEReceiver object with a SMIMEMessage object.
SMIMEReceiver(SMIMEMessage message, String provider)
          Create a SMIMEReceiver object with a SMIMEMessage object.
SMIMEReceiver(String filename)
          Create a SMIMEReceiver object with the file name of a SMIMEMessage.
SMIMEReceiver(String filename, String provider)
          Create a SMIMEReceiver object with the file name of a SMIMEMessage.
 
Method Summary
 Object clone()
          Creates a clone of this SMIMEReceiver object.
 CertificationRequest getCertificationRequest()
          Get the CertificationRequest object from the byte array of the PKCS #10 CertificationRequest object that is stored in the body the SMIMEMessage object for this SMIMEReceiver object.
 byte[] getCertificationRequestBytes()
          Get the DER-encoded byte array of the PKCS #10 CertificationRequest object that is stored in the body the SMIMEMessage object for this SMIMEReceiver object.
 ContentInfo getContentInfo()
          Get the ContentInfo object from the byte array of the PKCS #7 ContentInfo object that is stored in the body the SMIMEMessage object for this SMIMEReceiver object.
 byte[] getContentInfoBytes()
          Get the DER-encoded byte array of the PKCS #7 ContentInfo object that is stored in the body the SMIMEMessage object for this SMIMEReceiver object.
 byte[] getHeader()
          Get the byte array of the header the SMIMEMessage object for this SMIMEReceiver object.
 SMIMEMessage getSMIMEMessage()
          Get the SMIMEMessage object for this SMIMEReceiver object.
 String toString()
          Returns a string representation of this SMIMEReceiver object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SMIMEReceiver

public SMIMEReceiver(byte[] message)
              throws IOException
Create a SMIMEReceiver object with a byte array of a SMIMEMessage.
Parameters:
message - a byte array of a SMIMEMessage.
Throws:
IOException - on parsing errors.

SMIMEReceiver

public SMIMEReceiver(byte[] message,
                     String provider)
              throws IOException
Create a SMIMEReceiver object with a byte array of a SMIMEMessage.
Parameters:
message - a byte array of a SMIMEMessage.
provider - the provider to be used with pkcs.
Throws:
IOException - on parsing errors.

SMIMEReceiver

public SMIMEReceiver(InputStream in)
              throws IOException
Create a SMIMEReceiver object with an InputStream of a SMIMEMessage.
Parameters:
in - an InputStream containing a S/MIME message.
Throws:
IOException - on parsing errors.

SMIMEReceiver

public SMIMEReceiver(InputStream in,
                     String provider)
              throws IOException
Create a SMIMEReceiver object with an InputStream of a SMIMEMessage.
Parameters:
in - an InputStream containing a S/MIME message.
provider - the provider to be used with pkcs.
Throws:
IOException - on parsing errors.

SMIMEReceiver

public SMIMEReceiver(String filename)
              throws IOException
Create a SMIMEReceiver object with the file name of a SMIMEMessage.
Parameters:
filename - a name of a file containing a SMIMEMessage.
Throws:
IOException - on parsing errors.

SMIMEReceiver

public SMIMEReceiver(String filename,
                     String provider)
              throws IOException
Create a SMIMEReceiver object with the file name of a SMIMEMessage.
Parameters:
filename - a name of a file containing a SMIMEMessage.
provider - the provider to be used with pkcs.
Throws:
IOException - on parsing errors.

SMIMEReceiver

public SMIMEReceiver(SMIMEMessage message)
              throws IOException
Create a SMIMEReceiver object with a SMIMEMessage object.
Parameters:
message - SMIMEMessage object.
Throws:
IOException - on parsing errors.

SMIMEReceiver

public SMIMEReceiver(SMIMEMessage message,
                     String provider)
              throws IOException
Create a SMIMEReceiver object with a SMIMEMessage object.
Parameters:
message - SMIMEMessage object.
provider - the provider to be used with pkcs.
Throws:
IOException - on parsing errors.
Method Detail

clone

public Object clone()
Creates a clone of this SMIMEReceiver object. If SMIMEReceiver does not contain a SMIMEMessage, this method will return null.
Overrides:
clone in class Object
Returns:
clone of this SMIMEReceiver object.

getSMIMEMessage

public SMIMEMessage getSMIMEMessage()
Get the SMIMEMessage object for this SMIMEReceiver object.
Returns:
SMIMEMessage object

getContentInfoBytes

public byte[] getContentInfoBytes()
                           throws IOException
Get the DER-encoded byte array of the PKCS #7 ContentInfo object that is stored in the body the SMIMEMessage object for this SMIMEReceiver object. The body of the SMIMEMessage object will be decoded from BASE64-encoding.
Returns:
byte array of the contained ContentInfo object or null.

getContentInfo

public ContentInfo getContentInfo()
                           throws IOException
Get the ContentInfo object from the byte array of the PKCS #7 ContentInfo object that is stored in the body the SMIMEMessage object for this SMIMEReceiver object. The body of the SMIMEMessage object will be decoded from BASE64-encoding.
Returns:
contained ContentInfo object or null.

getCertificationRequestBytes

public byte[] getCertificationRequestBytes()
                                    throws IOException
Get the DER-encoded byte array of the PKCS #10 CertificationRequest object that is stored in the body the SMIMEMessage object for this SMIMEReceiver object. The body of the SMIMEMessage object will be decoded from BASE64-encoding.
Returns:
byte array of the contained CertificationRequest object or null.

getCertificationRequest

public CertificationRequest getCertificationRequest()
                                             throws IOException
Get the CertificationRequest object from the byte array of the PKCS #10 CertificationRequest object that is stored in the body the SMIMEMessage object for this SMIMEReceiver object. The body of the SMIMEMessage object will be decoded from BASE64-encoding.
Returns:
contained CertificationRequest object or null.

getHeader

public byte[] getHeader()
Get the byte array of the header the SMIMEMessage object for this SMIMEReceiver object.
Returns:
SMIMEMessage object

toString

public String toString()
Returns a string representation of this SMIMEReceiver object. Returns the contained SMIMEMessage object.
Overrides:
toString in class Object
Returns:
a string representation of this object.