Oracle Security Developer Tools S/MIME Java API Reference
10g (10.1.4.0.1)

B28172-01


oracle.security.crypto.smime
Class SmimeUtils

java.lang.Object
  extended byoracle.security.crypto.smime.SmimeUtils


public class SmimeUtils
extends java.lang.Object

Smime Utility functions.


Constructor Summary
SmimeUtils()
           

 

Method Summary
static void canonicalize(javax.mail.internet.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(javax.mail.internet.MimeBodyPart bodyPart)
          Convert a MimeBodyPart to a byte array.
static byte[] toBytes(javax.mail.internet.MimeBodyPart bodyPart, int length)
          Convert a MimeBodyPart to a byte array.
static void updateHeaders(javax.mail.internet.MimeBodyPart bodyPart)
          Deprecated.  

 

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

 

Constructor Detail

SmimeUtils

public SmimeUtils()

Method Detail

updateHeaders

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

toBytes

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

toBytes

public static byte[] toBytes(javax.mail.internet.MimeBodyPart bodyPart,
                             int length)
                      throws javax.mail.MessagingException,
                             java.io.IOException
Convert a MimeBodyPart to a byte array.
Parameters:
bodyPart - The content.
length - The content Length.
Throws:
javax.mail.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(javax.mail.internet.MimePart mp)
                         throws javax.mail.MessagingException
Applies MIME content canonicalization, recursively, to the given MimePart. Currently canonicalizes only content with top-level content type of "text".
Throws:
javax.mail.MessagingException

Oracle Security Developer Tools S/MIME Java API Reference
10g (10.1.4.0.1)

B28172-01


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