Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools S/MIME Java API Reference 10g Release 3 (10.1.3) B25379-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.crypto.smime
Class SmimeEnveloped

`java.lang.Object
oracle.security.crypto.smime.SmimeEnveloped`

All Implemented Interfaces:
  SmimeObject

public class SmimeEnveloped
extends java.lang.Object
implements SmimeObject

A S/MIME Enveloped Message.

Constructor Summary
`SmimeEnveloped(java.io.InputStream is)` Create a `SmimeEnveloped`.
`SmimeEnveloped(javax.mail.internet.MimeBodyPart content, oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID)` Create a `SmimeEnveloped`.

Method Summary
`void` | `addRecipient(oracle.security.crypto.cert.X509 cert)` Add a Recipient.
`void` | `addRecipient(oracle.security.crypto.cert.X509 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.
`javax.mail.internet.MimeBodyPart` | `getEnclosedBodyPart(oracle.security.crypto.core.PrivateKey recipientKey, oracle.security.crypto.cert.X509 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

### SmimeEnveloped

    public SmimeEnveloped(javax.mail.internet.MimeBodyPart content,
                          oracle.security.crypto.core.AlgorithmIdentifier contentEncryptionAlgID)
                   throws javax.mail.MessagingException,
                          java.io.IOException

  Create a `SmimeEnveloped`.
Parameters:
  `content` - The message content.
  `contentEncryptionAlgID` - The content encryption algorithm identifier.
Throws:
  `javax.mail.MessagingException` - An error occurred while setting the message content.
  `java.io.IOException`

### SmimeEnveloped

    public SmimeEnveloped(java.io.InputStream is)
                   throws java.io.IOException

  Create a `SmimeEnveloped`.
Parameters:
  `is` - The input stream.
Throws:
  `java.io.IOException` - The input encoding is incorrect or an I/O error occurred.

Method Detail

### getEnclosedBodyPart

    public javax.mail.internet.MimeBodyPart getEnclosedBodyPart(oracle.security.crypto.core.PrivateKey recipientKey,
                                                                oracle.security.crypto.cert.X509 recipientCert)
                                                         throws oracle.security.crypto.core.AlgorithmIdentifierException,
                                                                oracle.security.crypto.core.InvalidKeyException,
                                                                oracle.security.crypto.core.CipherException,
                                                                oracle.security.crypto.cms.UnknownRecipientException,
                                                                oracle.security.crypto.util.InvalidInputException,
                                                                javax.mail.MessagingException

  Returns the Decrypted Content.
  Parameters:
    `recipientKey` - The private key of the recipient.
    `recipientCert` - The X509 certificate of the recipient.
  Throws:
    `oracle.security.crypto.core.AlgorithmIdentifierException` - The content encryption algorithm is not supported.
    `oracle.security.crypto.core.InvalidKeyException` - The private key is not valid.
    `oracle.security.crypto.core.CipherException` - An error occurred during decryption.
    `oracle.security.crypto.util.InvalidInputException` - The message content type is incorrect.
    `javax.mail.MessagingException` - An error occurred while setting the decrypted content.
    `oracle.security.crypto.cms.UnknownRecipientException` - The key pair does not belong to message recipient.

### getContentEncryptionAlgID

    public oracle.security.crypto.core.AlgorithmIdentifier getContentEncryptionAlgID()

  Returns the content encryption algorithm.
  Returns:
    The encryption algorithm identifier.

### recipients

    public java.util.Enumeration recipients()

  Returns the message recipients.
  Returns:
    An `Enumeration` of `CMSRecipientInfo` objects.

### getEncryptedContent

    public byte[] getEncryptedContent()

  Returns the raw content (that is, without decrypting).
  Returns:
    The encrypted content.

### generateContentType

    public java.lang.String generateContentType(boolean useStandardContentTypes)

  Returns the content type.
  Specified by:
    `generateContentType` in interface `SmimeObject`
  Parameters:
    `useStandardContentTypes` - If `true` the standard content type is generated; If `false` the experimental content type is generated.
  Returns:
    The content type string.

### generateContentType

    public java.lang.String generateContentType()

  Returns the content type.
  Specified by:
    `generateContentType` in interface `SmimeObject`
  Returns:
    The content type string.

### addRecipient

    public void addRecipient(oracle.security.crypto.cert.X509 cert)
                      throws oracle.security.crypto.core.AlgorithmIdentifierException,
                             oracle.security.crypto.core.CipherException,
                             oracle.security.crypto.core.InvalidKeyException

  Add a Recipient.
  Parameters:
    `cert` - The X509 public key certificate.
  Throws:
    `oracle.security.crypto.core.AlgorithmIdentifierException` - The encryption algorithm is not supported.
    `oracle.security.crypto.core.CipherException` - An error occurred during encryption.
    `oracle.security.crypto.core.InvalidKeyException` - The public key is not valid.

### addRecipient

    public void addRecipient(oracle.security.crypto.cert.X509 cert,
                             oracle.security.crypto.core.AlgorithmIdentifier keyEncryptionAlgID)
                      throws oracle.security.crypto.core.AlgorithmIdentifierException,
                             oracle.security.crypto.core.CipherException,
                             oracle.security.crypto.core.InvalidKeyException

  Add a Recipient.
  Parameters:
    `cert` - The X509 public key certificate.
    `keyEncryptionAlgID` - The key transport algorithm.
  Throws:
    `oracle.security.crypto.core.AlgorithmIdentifierException` - The encryption algorithm is not supported.
    `oracle.security.crypto.core.CipherException` - An error occurred during encryption.
    `oracle.security.crypto.core.InvalidKeyException` - The public key is not valid.

### writeTo

    public void writeTo(java.io.OutputStream os,
                        java.lang.String mimeType)
                 throws java.io.IOException,
                        javax.mail.MessagingException

  Writes this `SmimeEnveloped` to the given output stream. Relevant canonicalizations, such as transforming text line-breaks to `CRLF`, are applied.
  Specified by:
    `writeTo` in interface `SmimeObject`
  Parameters:
    `os` - The output stream to which this `SmimeEnveloped` will be written.
    `mimeType` - Ignored.
  Throws:
    `java.io.IOException` - An I/O error occurred.
    `javax.mail.MessagingException` - An error occurred while creating the smime message.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools S/MIME Java API Reference 10g Release 3 (10.1.3) B25379-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005, 2006 , Oracle. All rights reserved.