public class pkcs10_content
extends java.lang.Object
implements javax.activation.DataContentHandler
Within the JavaBeans Activation Framework (JAF) data content handlers are used for writing certain data objects to streams, and parsing objects back from streams. Generally, applications do not immediately call the methods of a data content handler. Rather they use the access mechanisms provided by the corresponding DataHandler. The data handler itself internally will look for a proper data content handler supporting a the requested S/MIME type.
The JAF uses a RFC1524 mailcap file
for defining Java classes as content handlers for specific mime types. In
particular, this pkcs10_content class acts as a content handler
for the S/MIME types application/x-pkcs10 and - the newer one -
application/pkcs10, indicated by the following
statements in the corresponding mailcap file::
application/x-pkcs10;; x-java-content-handler=iaik.smime.pkcs10_content application/pkcs10;; x-java-content-handler=iaik.smime.pkcs10_contentNote that the IAIK-S/MIME distribution includes a ready-to-use mailcap file to be copied in the lib directory of your JDK (
More information about the JavaBeans Activation Framework may be obtained from http://java.sun.com/beans/glasgow/jaf.html.
| Constructor and Description |
|---|
pkcs10_content()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getContent(javax.activation.DataSource dataSource)
Returns an object representing the data which is encapsulated by the
supplied dataSource.
|
java.lang.Object |
getTransferData(java.awt.datatransfer.DataFlavor dataFlavor,
javax.activation.DataSource dataSource)
Returns an object representing the data to be transferred.
|
java.awt.datatransfer.DataFlavor[] |
getTransferDataFlavors()
Returns the DataFlavors indicating the flavors the data can be provided in.
|
void |
writeTo(java.lang.Object o,
java.lang.String mimeType,
java.io.OutputStream os)
Writes the supplied object to the given output stream.
|
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors in interface javax.activation.DataContentHandlerpublic java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor dataFlavor,
javax.activation.DataSource dataSource)
throws java.io.IOException
getTransferData in interface javax.activation.DataContentHandlerdataFlavor - the DataFlavor indicating the requested typedataSource - the DataSource supplying the encapsulated dataPKCS10Content or
for the supplied datajava.io.IOException - if an error occurs when parsing the datapublic java.lang.Object getContent(javax.activation.DataSource dataSource)
throws java.io.IOException
getContent in interface javax.activation.DataContentHandlerdataSource - the data source supplying the encapsulated dataPKCS10Content object
representing the supplied datajava.io.IOException - if an error occurs when parsing the datapublic void writeTo(java.lang.Object o,
java.lang.String mimeType,
java.io.OutputStream os)
throws java.io.IOException
This method only is able to handle objects supplied as instances
of PKCS10Content. If
the given object does not satisfy this criterion, an IOException
is thrown.
writeTo in interface javax.activation.DataContentHandlero - the object (an instance of PKCS10Content) to
be written to the streammimeType - the mimeType; not used hereos - the output stream to which to write the datajava.io.IOException - if the supplied object is not an instance of
PKCS10Content, or an error occurs while
writing to the stream