|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.smime.SMimeContent
public abstract class SMimeContent
Abstract class that implements some methods that are used by both,
EncryptedContent
and CompressedContent
.
Some of these method are also used by SignedContent
, but are
reimplemented there because multiple inheritence is not supported by Java.
EncryptedContent
,
CompressedContent
Constructor Summary | |
---|---|
protected |
SMimeContent()
Default constructor. |
Method Summary | |
---|---|
java.lang.Object |
getContent()
Returns the content as a Java object. |
java.lang.String |
getContentType()
Returns the ContentType header and any attached parameters. |
abstract javax.activation.DataHandler |
getDataHandler()
Returns a DataHandler holding the content. |
java.io.InputStream |
getInputStream()
Returns an InputStream from which the content can be read. |
void |
setBlockSize(int blockSize)
Sets the block size for defining the length of each definite primitive encoded octet string component. |
void |
setContent(javax.mail.Multipart multipart)
Supplies the content as MIME Multipart. |
void |
setContent(java.lang.Object content,
java.lang.String type)
Sets the content to be processed. |
void |
setContentContentHeaders(javax.mail.Header[] headers)
Set some headers for the entity to be signed. |
void |
setContentContentTransferEncoding(java.lang.String cte)
Sets the content transfer encoding of the entity to be signed. |
void |
setDataHandler(javax.activation.DataHandler dataHandler)
Sets the content wrapped by a javax.activation.DataHandler . |
void |
setText(java.lang.String text)
Sets the text content. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface iaik.smime.CryptoContent |
---|
getSMimeType, setHeaders |
Constructor Detail |
---|
protected SMimeContent()
Method Detail |
---|
public java.lang.String getContentType()
EncryptedContent
, or CompressedContent
as the content
of a MimeMessage, e.g.:
MimeMessage msg = ...; EncryptedContent ec = new EncryptedContent(); msg.setContent(ec, ec.getContentType()); ...or
MimeMessage msg = ...; CompressedContent compressed = ...; ... msg.setContent(compressed, compressed.getContentType()); ...
getContentType
in interface CryptoContent
public void setContent(java.lang.Object content, java.lang.String type) throws javax.mail.MessagingException
content
- a Java objecttype
- MIME type of this object
javax.mail.MessagingException
- if an error occurs while preparing the contentpublic void setContent(javax.mail.Multipart multipart) throws javax.mail.MessagingException
multipart
- the multipart content
javax.mail.MessagingException
- if an error occurs while preparing the contentpublic void setText(java.lang.String text) throws javax.mail.MessagingException
text
- the text content
javax.mail.MessagingException
- if an error occurs while preparing the contentpublic void setDataHandler(javax.activation.DataHandler dataHandler) throws javax.mail.MessagingException
javax.activation.DataHandler
.
The DataHandler wraps around the actual content.
For more information about DataHandler usage see the JavaBeans Activation Framework (JAF) sepecification.
dataHandler
- the DataHandler with the content to be compressed
javax.mail.MessagingException
- if an error occurs while preparing the contentpublic java.lang.Object getContent() throws java.io.IOException, javax.mail.MessagingException
java.io.IOException
- if an I/O error occurs when getting the content from the inherent data handler
javax.mail.MessagingException
- if an error occurs when fetching the inherent data handlerpublic abstract javax.activation.DataHandler getDataHandler() throws javax.mail.MessagingException
javax.mail.MessagingException
- if an error occurs when fetching the data handlerpublic java.io.InputStream getInputStream() throws java.io.IOException, javax.mail.MessagingException
java.io.IOException
- if an I/O error occurs when getting the input stream from the inherent data handler
javax.mail.MessagingException
- if an error occurs when fetching the inherent data handlerpublic void setContentContentTransferEncoding(java.lang.String cte)
setText
or
setDataHandler
has been used for
supplying the content. This method maybe called BEFORE setting the content
(to avoid header update overhead during the saveChanges run).
cte
- the content transfer encoding to be applied to the
inner entity to be signedpublic void setContentContentHeaders(javax.mail.Header[] headers)
setText
or
setDataHandler
has been used for
supplying the content. This method maybe called BEFORE setting the content
(to avoid header update overhead during the saveChanges run).
headers
- the headers to be applied to the
inner entity to be signedpublic void setBlockSize(int blockSize)
blockSize
is smaller or equal to zero the
whole encrypted data is encoded as definite primitive octet string.
blockSize
- for defining the encoding scheme and setting the octet
string component length, if positive
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |