public class SMimeBodyPart
extends javax.mail.internet.MimeBodyPart
This class shall used when creating a body part to be sent within a multipart/signed
message. When using the parent MimeBodyPart class no canonicalization
is performed.
| Constructor and Description |
|---|
SMimeBodyPart()
Creates a new SMimeBodyPart.
|
SMimeBodyPart(javax.mail.internet.InternetHeaders headers,
byte[] content)
Creates a new SMimeBodyPart from given header and content bytes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkForSMimeParts(boolean checkForSMimeParts)
Turns on/off control to use SMimeMultiparts and SMimeBodyParts insteadof MimeMultipatrs and
MimeBodyParts when supplying the content for this SMimeBodyPart.
|
void |
setDataHandler(javax.activation.DataHandler dh)
Sets the content wrapped by a
javax.activation.DataHandler. |
void |
writeTo(java.io.OutputStream os)
Writes the body part as an RFC 822 formatted stream and calculates a message
digest over the data.
|
addHeader, addHeaderLine, getAllHeaderLines, getAllHeaders, getContent, getContentID, getContentLanguage, getContentMD5, getContentStream, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getSize, isMimeType, removeHeader, setContent, setContent, setContentLanguage, setContentMD5, setDescription, setDescription, setDisposition, setFileName, setHeader, setText, setText, updateHeaderspublic SMimeBodyPart()
public SMimeBodyPart(javax.mail.internet.InternetHeaders headers,
byte[] content)
throws javax.mail.MessagingException
headers - the headerscontent - bytes representing the body of this part.javax.mail.MessagingException - if an error occurs when creating
this body partpublic void checkForSMimeParts(boolean checkForSMimeParts)
SMimeBodyPart objects rather than using plain
MimeBodyParts. When building a multipart entity from several body parts, the SMimeBodyParts
have to be inserted into a SMimeMultipart object instead
of using a plain MimeMultipart.
SignedContent, SMimeMultipart and/or SMimeBodyPart object or generally disable the SMimeBodyPart check throughout
the whole application environment.
When choosing the latter option by calling
SMimeParameters.setCheckForSMimeParts(false);take care to continue to use SMimeBodyParts and SMimeMultiparts when signing a newly created yet not canoinicalized content.
checkForSMimeParts - whether to turn on/off SMimePart checkingpublic void setDataHandler(javax.activation.DataHandler dh)
throws javax.mail.MessagingException
javax.activation.DataHandler.setDataHandler in interface javax.mail.PartsetDataHandler in class javax.mail.internet.MimeBodyPartdh - the dataHandler wrapping the contentjavax.mail.MessagingException - if the content supplied by the DataHandler
cannot be accessed or the content represents
a Multipart but is not supplied as SMimeMultipart
(in the case of SMimePart control is enabled)public void writeTo(java.io.OutputStream os)
throws java.io.IOException,
javax.mail.MessagingException
The message digest is set for the inherent JMailSMimeSigned object to be written as next part of the multipart/signed.
writeTo in interface javax.mail.PartwriteTo in class javax.mail.internet.MimeBodyPartos - the output stream where the content shall be written tojava.io.IOException - if an error occurs while writing to the streamjavax.mail.MessagingException - if an mail related error occurs