|
Oracle Fusion Middleware S/MIME Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10672-05 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.crypto.smime.SmimeEnveloped
public class SmimeEnveloped
A S/MIME Enveloped Message.
Constructor Summary | |
---|---|
SmimeEnveloped(java.io.InputStream is) Create a SmimeEnveloped . |
|
SmimeEnveloped(MimeBodyPart content, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID) Create a SmimeEnveloped . |
Method Summary | |
---|---|
void |
addRecipient(java.security.cert.X509Certificate cert) Add a Recipient. |
void |
addRecipient(java.security.cert.X509Certificate cert, oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID) Add a Recipient. |
java.lang.String |
generateContentType() Returns the content type. |
java.lang.String |
generateContentType(boolean useStandardContentTypes) Returns the content type. |
oracle.security.crypto.core.AlgorithmIdentifier |
getContentEncryptionAlgID() Returns the content encryption algorithm. |
MimeBodyPart |
getEnclosedBodyPart(java.security.PrivateKey recipientKey, java.security.cert.X509Certificate recipientCert) Returns the Decrypted Content. |
byte[] |
getEncryptedContent() Returns the raw content (that is, without decrypting). |
java.util.Enumeration |
recipients() Returns the message recipients. |
void |
writeTo(java.io.OutputStream os, java.lang.String mimeType) Writes this SmimeEnveloped to the given output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SmimeEnveloped(MimeBodyPart content, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID) throws MessagingException, java.io.IOException
SmimeEnveloped
.
content
- The message content.contentEncryptionAlgID
- The content encryption algorithm identifier.MessagingException
- An error occurred while setting the message content.java.io.IOException
public SmimeEnveloped(java.io.InputStream is) throws java.io.IOException
SmimeEnveloped
.
is
- The input stream.java.io.IOException
- The input encoding is incorrect or an I/O error occurred.Method Detail |
---|
public MimeBodyPart getEnclosedBodyPart(java.security.PrivateKey recipientKey, java.security.cert.X509Certificate recipientCert) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, oracle.security.crypto.cms.UnknownRecipientException, java.io.IOException, java.security.cert.CertificateEncodingException, oracle.security.crypto.util.InvalidInputException, MessagingException, javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.NoSuchPaddingException
Note the changes in the exceptions
Exceptions no longer thrown - AlgorithmIdentifierException,CipherException
Exceptions introduced - IOException,CertificateEncodingException, NoSuchAlgorithmException,BadPaddingException, IllegalBlockSizeException,NoSuchPaddingException
recipientKey
- The private key of the recipient.recipientCert
- The X509 certificate of the recipient.java.security.NoSuchAlgorithmException
- The content encryption algorithm is not supported.java.security.InvalidKeyException
- The private key is not valid.javax.crypto.BadPaddingException
- Expected padding mechanism not found.javax.crypto.IllegalBlockSizeException
- Data not multiple of the block sizejavax.crypto.NoSuchPaddingException
- Requested Padding Mechanism not supportedoracle.security.crypto.util.InvalidInputException
- The message content type is incorrect.MessagingException
- An error occurred while setting the decrypted content.oracle.security.crypto.cms.UnknownRecipientException
- The key pair does not belong to message recipient.java.security.cert.CertificateEncodingException
- Specifies an encoding errorjava.io.IOException
- Input/Output Exception while instantiating X509 from an inputstreampublic oracle.security.crypto.core.AlgorithmIdentifier getContentEncryptionAlgID()
public java.util.Enumeration recipients()
Enumeration
of CMSRecipientInfo
objects.public byte[] getEncryptedContent()
public java.lang.String generateContentType(boolean useStandardContentTypes)
generateContentType
in interface SmimeObject
useStandardContentTypes
- If true
the standard content type is generated; If false
the experimental content type is generated.public java.lang.String generateContentType()
generateContentType
in interface SmimeObject
public void addRecipient(java.security.cert.X509Certificate cert) throws java.security.NoSuchAlgorithmException, javax.crypto.IllegalBlockSizeException, javax.crypto.BadPaddingException, javax.crypto.NoSuchPaddingException, java.security.InvalidKeyException, java.security.cert.CertificateEncodingException, java.io.IOException
cert
- The X509 public key certificate.
Note the changes in the method signature
Previously : public void addRecipient (X509)
Now : public void addRecipient (X509Certificate )
Note the changes in the exceptions
Exceptions no longer thrown - AlgorithmIdentifierException,CipherException
Exceptions introduced - IOException,CertificateEncodingException, NoSuchAlgorithmException, IllegalBlockSizeException,BadPaddingException,NoSuchPaddingException
java.security.NoSuchAlgorithmException
- The content encryption algorithm is not supported.javax.crypto.BadPaddingException
- Expected padding mechanism not found.javax.crypto.IllegalBlockSizeException
- Data not multiple of the block sizejavax.crypto.NoSuchPaddingException
- Requested Padding Mechanism not supportedjava.security.cert.CertificateEncodingException
- Specifies an encoding errorjava.io.IOException
- Input/Output Exception while instantiating X509 rom an inputstreamjava.security.InvalidKeyException
- The key is invalidpublic void addRecipient(java.security.cert.X509Certificate cert, oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.BadPaddingException, java.security.InvalidKeyException, java.security.cert.CertificateEncodingException, java.io.IOException
Note the changes in the method signature
Previously : public void addRecipient (X509 ,AlgorithmIdentifier)
Now : public void addRecipient (X509Certificate ,AlgorithmIdentifier)
Note the changes in the exceptions
Exceptions no longer thrown - AlgorithmIdentifierException,CipherException
Exceptions introduced - IOException,CertificateEncodingException, NoSuchAlgorithmException, NoSuchPaddingException,IllegalBlockSizeException,BadPaddingException
cert
- The X509 public key certificate.keyEncryptionAlgID
- The key transport algorithm.java.security.NoSuchAlgorithmException
- The content encryption algorithm is not supported.javax.crypto.BadPaddingException
- Expected padding mechanism not found.javax.crypto.IllegalBlockSizeException
- Data not multiple of the block sizejavax.crypto.NoSuchPaddingException
- Requested Padding Mechanism not supportedjava.security.InvalidKeyException
- Invalid key for encryptionjava.security.cert.CertificateEncodingException
- Specifies an encoding errorjava.io.IOException
- Input/Output Exception while instantiating X509 from an inputstreampublic void writeTo(java.io.OutputStream os, java.lang.String mimeType) throws java.io.IOException, MessagingException
SmimeEnveloped
to the given output stream. Relevant canonicalizations, such as transforming text line-breaks to CRLF
, are applied.writeTo
in interface SmimeObject
os
- The output stream to which this SmimeEnveloped
will be written.mimeType
- Ignored.java.io.IOException
- An I/O error occurred.MessagingException
- An error occurred while creating the smime message.
|
Oracle Fusion Middleware S/MIME Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10672-05 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |