Skip navigation links

Oracle Security Developer Tools S/MIME Java API Reference
11g (11.1.1)

E10672-02


oracle.security.crypto.smime
Class SmimeUtils

java.lang.Object
  extended by oracle.security.crypto.smime.SmimeUtils


public class SmimeUtils
extends java.lang.Object

Smime Utility functions.


Field Summary
static java.lang.String DEFAULT_Cert_HASH_ALG
           

 

Constructor Summary
SmimeUtils()
           

 

Method Summary
static void canonicalize(MimePart mp)
          Applies MIME content canonicalization, recursively, to the given MimePart.
static javax.activation.FileDataSource createFileDataSource(java.io.File file, java.lang.String contentTypeHeader)
          Creates an instance of javax.activation.FileDataSource.
static javax.activation.FileDataSource createFileDataSource(java.lang.String name, java.lang.String contentTypeHeader)
          Creates an instance of javax.activation.FileDataSource.
static byte[] toBytes(MimeBodyPart bodyPart)
          Convert a MimeBodyPart to a byte array.
static byte[] toBytes(MimeBodyPart bodyPart, int length)
          Convert a MimeBodyPart to a byte array.
static void updateHeaders(MimeBodyPart bodyPart)
          Deprecated.  

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

DEFAULT_Cert_HASH_ALG

public static final java.lang.String DEFAULT_Cert_HASH_ALG
See Also:
Constant Field Values

Constructor Detail

SmimeUtils

public SmimeUtils()

Method Detail

updateHeaders

public static void updateHeaders(MimeBodyPart bodyPart)
                          throws MessagingException
Deprecated. 
Updates the headers of the message being constructed.
Throws:
MessagingException

toBytes

public static byte[] toBytes(MimeBodyPart bodyPart)
                      throws MessagingException,
                             java.io.IOException
Convert a MimeBodyPart to a byte array.
Parameters:
bodyPart - The content.
Throws:
MessagingException - An error occurred while canonicalizing the content.
java.io.IOException - An I/O error occurred.

toBytes

public static byte[] toBytes(MimeBodyPart bodyPart,
                             int length)
                      throws MessagingException,
                             java.io.IOException
Convert a MimeBodyPart to a byte array.
Parameters:
bodyPart - The content.
length - The content Length.
Throws:
MessagingException - An error occurred while canonicalizing the content.
java.io.IOException - An I/O error occurred.

createFileDataSource

public static javax.activation.FileDataSource createFileDataSource(java.io.File file,
                                                                   java.lang.String contentTypeHeader)
Creates an instance of javax.activation.FileDataSource.

Use this method rather than directly instantiating a FileDataSource if transparent handling of multipart or multipart/signed S/MIME types is desired. (The default FileDataSource included with JAF 1.0.1 does not handle multipart MIME boundaries when used with Javamail 1.1.3.)

Parameters:
file - The file from which to create this data source.
contentTypeHeader - The content type MIME header string (may be null).
Returns:
A newly instantiated FileDataSource.

createFileDataSource

public static javax.activation.FileDataSource createFileDataSource(java.lang.String name,
                                                                   java.lang.String contentTypeHeader)
Creates an instance of javax.activation.FileDataSource.

Use this method rather than directly instantiating a FileDataSource if transparent handling of multipart or multipart/signed S/MIME types is desired. (The default FileDataSource included with JAF 1.0.1 does not handle multipart MIME boundaries when used with Javamail 1.1.3.)

Parameters:
name - The name of the file from which to create this data source.
contentTypeHeader - The content type MIME header string (may be null).
Returns:
A newly instantiated FileDataSource.

canonicalize

public static void canonicalize(MimePart mp)
                         throws MessagingException
Applies MIME content canonicalization, recursively, to the given MimePart. Currently canonicalizes only content with top-level content type of "text".
Throws:
MessagingException

Skip navigation links

Oracle Security Developer Tools S/MIME Java API Reference
11g (11.1.1)

E10672-02


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