|
Enhydra-Oyster 2.1-7 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.oyster.smime.BaseSMIMEObject
org.enhydra.oyster.smime.BaseSignedSMIMEObject
org.enhydra.oyster.smime.SignedSMIME
SignedSMIME class is used for creating and sending signed S/MIME message.
Email message is in general composed of the content of the message and of one or
more attachments. The content is visible part of the message, and attacments are
mostly files or other binary data, which are not visible parts of message and
which are used by email as a transport medium. In this implementation content
can be represented in two different forms:
Field Summary |
Fields inherited from class org.enhydra.oyster.smime.BaseSignedSMIMEObject |
aditionalCerts, capabilities, capabilities2, capabilitiesTemp, certChainArray, digestArray, digestArray2, including, including2, ksArray, privKeyArray |
Fields inherited from class org.enhydra.oyster.smime.BaseSMIMEObject |
bodyPartArray, certArray, charsetEnc, contentPresence, externalMessagePresence, indicatorTo, message |
Fields inherited from interface org.enhydra.oyster.crypto.consts.SignedConstants |
MD2_WITH_RSA, MD5_WITH_RSA, SHA1_WITH_DSA, SHA1_WITH_RSA |
Fields inherited from interface org.enhydra.oyster.crypto.consts.KeyStoreConstants |
BKS, JKS, PKCS12, UBER |
Constructor Summary | |
protected |
SignedSMIME()
Simple constructor. |
|
SignedSMIME(javax.mail.internet.MimeMessage mimeMessage)
Construction of message with external prepared MimeMessage object. |
|
SignedSMIME(java.lang.String smtpHost,
java.lang.String fromAddress,
java.lang.String subject,
java.lang.String charset)
Initializes the JavaMail session for SMTP and the MimeMessage object for message which will be sent. |
|
SignedSMIME(java.lang.String smtpHost,
java.lang.String fromAddress,
java.lang.String subject,
java.lang.String content,
java.lang.String charset)
Initializes the JavaMail session for SMTP and the MimeMessage object for message which will be sent. |
Method Summary | |
void |
addRecipient(java.lang.String recipientAddress,
java.lang.String type)
Adds recipient email address and type. |
javax.mail.internet.MimeMessage |
getSignedMessage()
Deprecated. |
void |
signing()
Creates and signes the message with default implicit signing. |
void |
signing(boolean externalSignature)
Creates and signes the message. |
Methods inherited from class org.enhydra.oyster.smime.BaseSignedSMIMEObject |
addCertificate, addSigner, addSigner, addSigner, addSigner, reset, setCapabilities |
Methods inherited from class org.enhydra.oyster.smime.BaseSMIMEObject |
addAttachment, addAttachment, addAttachment, addAttachment, addAttachment, addAttachment, addRecipient, addRecipient, addRecipient, getMimeMessage, initMimeMessage, send, setCharsetEncoding, setContent, setContent, setContent, setContent, setContent, setContent, setContent, setContent, setContent, setContent, setReply |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected SignedSMIME()
public SignedSMIME(java.lang.String smtpHost, java.lang.String fromAddress, java.lang.String subject, java.lang.String content, java.lang.String charset) throws SMIMEException
smtpHost
- name of SMTP host used for sending emailfromAddress
- email address of sender (FROM field in email header)subject
- subject of email (SUBJECT field in email header). This
argument can be null, but email message will be sent withouth SUBJECT.content
- text/plain content of email message. This argument can be
null, but later one of setContent() methods or one of addAttachment()
methods should be calledcharset
- character set for passed subject and content. The given
Unicode string will be charset-encoded using the specified charset. The
charset is also used to set the "charset" parameter. For example German
letters should be encoded by usage of 'ISO-8859-1' charset. If charset
parameter is null and subject or content contains non US-ASCII characters,
it will be encoded using the platform's default charset.
SMIMEException
- if smtpHost or fromAddress parameters are null.
Also, it can be caused by non SMIMEException which is MessagingException.public SignedSMIME(java.lang.String smtpHost, java.lang.String fromAddress, java.lang.String subject, java.lang.String charset) throws SMIMEException
smtpHost
- name of SMTP host used for sending emailfromAddress
- email address of sender (FROM field in email header)subject
- subject of email (SUBJECT field in email header). This
argument can be null, but email message will be sent withouth SUBJECT.charset
- character set for passed subject and content. The given
Unicode string will be charset-encoded using the specified charset. The
charset is also used to set the "charset" parameter. For example German
letters should be encoded by usage of 'ISO-8859-1' charset. If charset
parameter is null and subject or content contains non US-ASCII characters,
it will be encoded using the platform's default charset.
SMIMEException
- if smtpHost or fromAddress parameters are null.
Also, it can be caused by non SMIMEException which is MessagingException.public SignedSMIME(javax.mail.internet.MimeMessage mimeMessage) throws SMIMEException
mimeMessage
- external created MimeMessage object
SMIMEException
- if smtpHost or fromAddress parameter is null.
Also, it can be caused by non SMIMEException which is MessagingException.Method Detail |
public void addRecipient(java.lang.String recipientAddress, java.lang.String type) throws SMIMEException
recipientAddress
- email address of recipent (fields TO or CC or BCC
in email message header)type
- should be TO, CC or BCC.
SMIMEException
- if type of addressing of the messages is not TO, CC,
or BCC. Also it can be caused by non SMIMEException which is MessagingException.public void signing() throws SMIMEException
SMIMEException
- if one of recipients is not declared as TO
recipient, or if there is no message for signing. Also, it can be caused
by non SMIMEException which can be one of the following: MessagingException
or IOException.public void signing(boolean externalSignature) throws SMIMEException
externalSignature
- choice between implicit and explicit signing
(true = explicit or external signing, false = implicit or internal signing).
SMIMEException
- if one of recipients is not declared as TO
recipient, or if there is no message for signing. Also, it can be caused
by non SMIMEException which can be one of the following: MessagingException,
or IOException.public javax.mail.internet.MimeMessage getSignedMessage()
|
Enhydra-Oyster 2.1-7 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |