|
Oracle Email Java API Reference Release 2(9.0.4) B10724-01 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.mail.sdk.esmail.OracleSMimeBodyPart
This class supports SMime functionality for decrypting and verifying smime encrypted and signed message parts. A user's certificates and keys may be passed in as FileInputStreams or a file path. The certificates and keys are read in and the decrypted part is returned as a MimeBodyPart object. Internally, S/MIME V3 toolkit wrappers based on S/MIME v3 RFC 2630 and RFC 2634 ESS specifications are called.
Field Summary | |
static int |
DES_CBC Encryption Algorithm: DES_CBC |
static int |
DES_EDE3_CBC Encryption Algorithm: DES_EDE3_CBC |
static int |
DSA Signature Algorithm: DSA |
static int |
MD5 Digest Algorithm: MD5 |
static int |
RC2_CBC_128 Encryption Algorithm: RC2_CBC_128 |
static int |
RC2_CBC_40 Encryption Algorithm: RC2_CBC_40 |
static int |
RC2_CBC_64 Encryption Algorithm: RC2_CBC_64 |
static int |
RSA Signature Algorithm: RSA |
static int |
SHA1 Digest Algorithm: SHA1 |
Constructor Summary | |
OracleSMimeBodyPart() |
Method Summary | |
static oracle.mail.sdk.esmail.MimeBodyPart |
decode(java.io.FileInputStream userCert, java.io.FileInputStream userPrvKey, java.io.ByteArrayInputStream decodedStream) This method takes in the user certificate and the private keys as FileInputStream and the content of the message part to decode and returns a decrypted MimeBodyPart object. |
static oracle.mail.sdk.esmail.MimeBodyPart |
decode(java.lang.String userCertFileName, java.lang.String userPrvKeyFileName, java.io.ByteArrayInputStream decodedStream) This method takes in the user certificate file location and the private key file location and the content of the message part to decode and returns a decrypted MimeBodyPart object. |
static oracle.mail.sdk.esmail.MimeMessage |
encryptMessage(oracle.mail.sdk.esmail.MimeMessage message, oracle.mail.sdk.esmail.Session session, java.io.InputStream userCertificate, java.io.InputStream userPrivateKey, java.io.InputStream[] recipientCertificates, boolean includeOrigCerts, boolean includeOrigAsRecip, int encryptAlgorithm) Encrypt a mime message. |
static void |
setDebugOff() Turn debugging off |
static void |
setDebugOn() Turn debugging on. |
static oracle.mail.sdk.esmail.MimeMessage |
signMessage(oracle.mail.sdk.esmail.MimeMessage message, oracle.mail.sdk.esmail.Session session, java.io.InputStream userCertificate, java.io.InputStream userPrivateKey, boolean includeOrigCerts, int digestAlgorithm, int signatureAlgorithm) Digitally sign a mime message. |
static oracle.mail.sdk.esmail.MimeMessage |
signNencryptMessage(oracle.mail.sdk.esmail.MimeMessage message, oracle.mail.sdk.esmail.Session session, java.io.InputStream userCertificate, java.io.InputStream userPrivateKey, java.io.InputStream[] recipientCertificates, boolean includeOrigCerts, boolean includeOrigAsRecip, int encryptAlgorithm, int digestAlgorithm, int signatureAlgorithm) Digitally sign and encrypt a mime message. |
static int |
verify_message(java.io.FileInputStream userCertificate, java.io.FileInputStream userPrivateKey, java.io.ByteArrayInputStream[] originalContent, java.io.InputStream[] signatureCertificates, java.io.InputStream signature) This method takes in the user certificate file and the private keys file, the content of the message part that contains the signature to verify, the sinature certificates and the actual signature and returns an integer value(1 - verified, 0 - not verified). |
static int |
verify_message(java.lang.String userCertFileName, java.lang.String userPrvKeyFileName, java.io.ByteArrayInputStream[] originalContent, java.io.InputStream[] signatureCertificates, java.io.InputStream signature) This method takes in the user certificate filename and the private keys filename, the content of the message part that contains the signature to verify, the sinature certificates and the actual signature and returns an integer value(1 - verified, 0 - not verified). |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SHA1
public static final int MD5
public static final int DES_EDE3_CBC
public static final int DES_CBC
public static final int RC2_CBC_128
public static final int RC2_CBC_64
public static final int RC2_CBC_40
public static final int RSA
public static final int DSA
Constructor Detail |
public OracleSMimeBodyPart()
Method Detail |
public static void setDebugOn()
Debug information is written to System.Out
public static void setDebugOff()
public static oracle.mail.sdk.esmail.MimeBodyPart decode(java.lang.String userCertFileName, java.lang.String userPrvKeyFileName, java.io.ByteArrayInputStream decodedStream)
This method takes in the user certificate file location and the private key file location and the content of the message part to decode and returns a decrypted MimeBodyPart object.
userCertFileName
- user certificate file locationuserPrvKeyFileName
- private key file locationdecodedStream
- body part as a ByteArrayInputStreampublic static oracle.mail.sdk.esmail.MimeBodyPart decode(java.io.FileInputStream userCert, java.io.FileInputStream userPrvKey, java.io.ByteArrayInputStream decodedStream)
This method takes in the user certificate and the private keys as FileInputStream and the content of the message part to decode and returns a decrypted MimeBodyPart object.
userCert
- user certificateuserPrvKey
- private keydecodedStream
- body part as a ByteArrayInputStreampublic static int verify_message(java.lang.String userCertFileName, java.lang.String userPrvKeyFileName, java.io.ByteArrayInputStream[] originalContent, java.io.InputStream[] signatureCertificates, java.io.InputStream signature) throws java.lang.Exception
This method takes in the user certificate filename and the private keys filename, the content of the message part that contains the signature to verify, the sinature certificates and the actual signature and returns an integer value(1 - verified, 0 - not verified).
userCertFileName
- user certificate filenameuserPrvKeyFileName
- private key filenameoriginalContent
- body part contentsignatureCertificates
- signature certificatesignature
- signaturepublic static int verify_message(java.io.FileInputStream userCertificate, java.io.FileInputStream userPrivateKey, java.io.ByteArrayInputStream[] originalContent, java.io.InputStream[] signatureCertificates, java.io.InputStream signature) throws java.lang.Exception
This method takes in the user certificate file and the private keys file, the content of the message part that contains the signature to verify, the sinature certificates and the actual signature and returns an integer value(1 - verified, 0 - not verified).
userCertificate
- user certificate fileuserPrivateKey
- private key fileoriginalContent
- body part contentsignatureCertificates
- signature certificatesignature
- signaturepublic static oracle.mail.sdk.esmail.MimeMessage encryptMessage(oracle.mail.sdk.esmail.MimeMessage message, oracle.mail.sdk.esmail.Session session, java.io.InputStream userCertificate, java.io.InputStream userPrivateKey, java.io.InputStream[] recipientCertificates, boolean includeOrigCerts, boolean includeOrigAsRecip, int encryptAlgorithm) throws oracle.mail.sdk.esmail.MessagingException, java.io.IOException, java.lang.Exception
Encrypt a mime message.
The user's certificate, private key, and the list of recipients' certificate is used to encrypt the passed in mime message and return a new encrypted MimeMessage object.
message
- the mime message to be encryptedsession
- the user's session; this is used for creating a new encrypted mime messageuserCertificate
- the user's certificate; containing the ASN.1 encoded X.509 user S/MIME certificate. All data should already be available.userPrivateKey
- the user's private key; containing the PKCS-8 encoded user private key. All data should already be available.recipientCertificates
- the recipients' certificatesincludeOrigCerts
- a flag to determine whether to include the originator's certifcate in the encrypted message.includeOrigAsRecip
- a flag to determine whether to include the originator as one of the recipients.encryptAlgorithm
- the alogorithm to use for encryption.public static oracle.mail.sdk.esmail.MimeMessage signMessage(oracle.mail.sdk.esmail.MimeMessage message, oracle.mail.sdk.esmail.Session session, java.io.InputStream userCertificate, java.io.InputStream userPrivateKey, boolean includeOrigCerts, int digestAlgorithm, int signatureAlgorithm) throws oracle.mail.sdk.esmail.MessagingException, java.io.IOException, java.lang.Exception
Digitally sign a mime message.
message
- the mime message to be digitally signedsession
- the user's session; this is used for creating a new digitally signed mime messageuserCertificate
- the user's certificate; containing the ASN.1 encoded X.509 user S/MIME certificate. All data should alread be availabe.userPrivateKey
- the user's private key; containing the PKCS-8 encoded user private key. All data should already be available.recipientCertificates
- the recipients' certificatesincludeOrigCerts
- a flag to determine whether to include the originator's certifcate in the signed message.digestAlgorithm
- the digest alogorithm to be used.signatureAlgorithm
- the alogorithm to use for digitally signing.public static oracle.mail.sdk.esmail.MimeMessage signNencryptMessage(oracle.mail.sdk.esmail.MimeMessage message, oracle.mail.sdk.esmail.Session session, java.io.InputStream userCertificate, java.io.InputStream userPrivateKey, java.io.InputStream[] recipientCertificates, boolean includeOrigCerts, boolean includeOrigAsRecip, int encryptAlgorithm, int digestAlgorithm, int signatureAlgorithm) throws oracle.mail.sdk.esmail.MessagingException, java.io.IOException, java.lang.Exception
Digitally sign and encrypt a mime message.
This method signs a mime message and then encrypt it. It returns a new mime message.
message
- the mime message to be encryptedsession
- the user's session; this is used for creating a new signed and encrypted mime messageuserCertificate
- the user's certificate; containing the ASN.1 encoded X.509 user S/MIME certificate. All data should already be available.userPrivateKey
- the user's private key; containing the PKCS-8 encoded user private key. All data should already be available.recipientCertificates
- the recipients' certificatesincludeOrigCerts
- a flag to determine whether to include the originator's certifcate in the encrypted message.includeOrigAsRecip
- a flag to determine whether to include the originator as one of the recipients.encryptAlgorithm
- the alogorithm to use for encryption.digestAlgorithm
- the digest alogorithm to be used.signatureAlgorithm
- the alogorithm to use for digitally signing.
|
Oracle Email Java API Reference Release 2(9.0.4) B10724-01 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |