Oracle SMIME 6-7
SmimeMultipartSigned javax.mail.internet.MimeBodyPart bodyPart, oracle.security.crypto.core.AlgorithmIdentifier digestAlgID
Creates a new SmimeMultipartSigned message, with the specified MIME body part and message digest algorithm.
void addBodyPart javax.mail.BodyPart part Inherited from javax.mail.Multipart, adds the specified body part to this
SmimeMultipartSigned object. See the javax.mail API documentation at http:java.sun.comproductsjavamailjavadocsjavaxmailBodyPa
rt.html for more details.
void addSignature java.security.PrivateKey signerKey, java.security.cert.X509Certificate signerCert
Adds a signature to the message, using the specified private key and certificate. void addSignature java.security.PrivateKey signerKey,
java.security.cert.X509Certificate signerCert, java.util.Date timeStamp Adds a signature to the message, using the specified private key and certificate plus a
time stamp. void addSignature java.security.PrivateKey signerKey,
java.security.cert.X509Certificate signerCert, java.util.Date timeStamp, SmimeCapabilities smimeCaps
Adds a signature to the message, using the specified private key and certificate, plus SMIME capabilities.
javax.mail.internet.MimeBodyPart getEnclosedBodyPart Returns the MIME body part that was signed.
Use the following code to build a new message: Create a new SMIME Multipart Signed Message with a specified
MIME body part and a specified digest algorithm MimeBodyPart bp = new MimeBodyPart;
bp.setTextHello from SendSignedMsg; AlgorithmIdentifier algId = AlgID.sha1;
SmimeMutlipartSigned sig = new SmimeMultipartSignedbp, algId;
To parse a message, use the constructor that takes a javax.activation.DataSource:
DataSource ds = Data source containing message to be parsed SmimeMultipartSigned sig = new SmimeMultipartSignedds;
6.3.1.6 The oracle.security.crypto.smime.SmimeSignedReceipt Class
The oracle.security.crypto.smime.SmimeSignedReceipt class represents an SMIME wrapped and signed receipt. You may use this class to build a new
message or parse an existing one.
To build a new message, use any of these four constructors: Create a new SMIME wrapped and signed receipt with the specified receipt,
the specified digest of the messages signed attributes and the addresses of the receipt recipients
ESSReceipt receipt = ESS receipt to include in message byte [] msgSigDigest = Digest of signed attributes to be included in message
Address [] addresses = Addresses of receipt recipients SmimeSignedReceipt sig = new SmimeSignedreceipt, msgSigDigest, addresses;
6-8 Oracle Fusion Middleware Reference for Oracle Security Developer Tools
-OR- Create a new SMIME wrapped and signed receipt
with a specified SMIME Signed Message containing the receipt SmimeSignedObject sso = SMIME signed message containing receipt
SmimeSignedReceipt sig1 = new SmimeSignedReceiptsso;
-OR- Create a new SMIME wrapped and signed receipt with a
specified SMIME Signed Message containing the receipt, the signers certificate and the addresses of the receipt recipients
SmimeSignedObject sso1 = SMIME signed message containing receipt X509Certificate signerCert = The message signers certificate
Address [] addresses1 = Addresses of receipt recipients SmimeSignedReceipt sig2 = new SmimeSignedReceiptsso1, signerCert, addresses1;
-OR- Create a new SMIME wrapped and signed receipt with a
specified SMIME Signed Message containing the receipt, the signers certificate, the addresses of the receipt recipients and
a specified MLExpansionHistory attribute. SmimeSignedObject sso1 = SMIME signed message containing receipt
X509Certificate signerCert = The message signers certificate Address [] addresses1 = Addresses of receipt recipients
MLExpansionHistory mlExpansionHistory = The MLExpansionHistory attribute SmimeSignedReceipt sig2 =
new SmimeSignedReceiptsso1, signerCert, addresses1, mlExpansionHistory; To parse a message, use the constructor that takes a java.io.InputStream:
InputStream is = Input stream containing message to be parsed SmimeSignedReceipt sig = new SmimeSignedReceiptis;
6.3.1.7 The oracle.security.crypto.smime.SmimeCompressed Class