com.ibm.security.smime.jmail
Class PKCS10MimeHandler

com.ibm.security.smime.jmail.PKCS10MimeHandler

public class PKCS10MimeHandler

The PKCS10MimeHandler class extends the capabilities of the DataHandler's implementation in support of the PKCS10MimeDataSource object.

See Also:
PKCS10MimeDataSource, CertificationRequest

Constructor Summary
PKCS10MimeHandler()
           
PKCS10MimeHandler(String provider)
           
 
Method Summary
 Object getContent(DataSource ds)
          Return the CertificationRequest object contained within the DataSource.
 Object getTransferData(DataFlavor df, DataSource ds)
          Returns a CertificationRequest object which represents the data to be transferred.
 DataFlavor[] getTransferDataFlavors()
          Returns an array of DataFlavor objects indicating the flavors the data can be provided in.
 String toString()
          Returns a string representation of this PKCS10MimeHandler object.
 void writeTo(Object obj, String mimeType, OutputStream os)
          Convert the CertificationRequest object to a DER-encoded byte stream of the supported MIME type and write it to the output stream.
 

Constructor Detail

PKCS10MimeHandler

public PKCS10MimeHandler()

PKCS10MimeHandler

public PKCS10MimeHandler(String provider)
Method Detail

getContent

public Object getContent(DataSource ds)
                  throws IOException
Return the CertificationRequest object contained within the DataSource.
Parameters:
ds - DataSource PKCS10MimeDataSource
Returns:
Object CertificationRequest or null.

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The supported mimetype is "application/x-pkcs10".
Returns:
Array of DataFlavor objects.

getTransferData

public Object getTransferData(DataFlavor df,
                              DataSource ds)
                       throws UnsupportedFlavorException,
                              IOException
Returns a CertificationRequest object which represents the data to be transferred. The DataFlavor mimetype must be one of the supported mimetypes.
Parameters:
df - DataFlavor with a supported mimetype
ds - DataSource of type PKCS10MimeDataSource
Returns:
CertificationRequest or null

writeTo

public void writeTo(Object obj,
                    String mimeType,
                    OutputStream os)
             throws IOException
Convert the CertificationRequest object to a DER-encoded byte stream of the supported MIME type and write it to the output stream.
Parameters:
obj - CertificationRequest
mimeType - mimeType
os - OutputStream

toString

public String toString()
Returns a string representation of this PKCS10MimeHandler object.
Returns:
a string representation of this object.