iaik.smime.ess.utils
Class ESSLayer

java.lang.Object
  extended by iaik.smime.ess.utils.ESSLayer
Direct Known Subclasses:
EnvelopedESSLayer, SignedESSLayer

public class ESSLayer
extends java.lang.Object

A wrapper for an ESS S/MIME layer.


Field Summary
protected  java.lang.Object content_
          The content of this ESSLayer.
protected  javax.activation.DataHandler dataHandler_
          The DataHandler that may wrap the content.
static int ENVELOPED_DATA
          ESSLayer type CMS ENVELOPED_DATA (1).
static int SIGNED_DATA
          ESSLayer type CMS SIGNED_DATA (0).
protected  int type_
          The type of this ESS layer, either SIGNED_DATA (0) or ENVELOPED_DATA (1), or -1 (any other type).
 
Constructor Summary
  ESSLayer(java.lang.Object content)
          Creates an ESSLayer for the given content, which may represent a cryptographically enhanced S/MIME entity like SignedContent or EncryptedContent, or any other type of content.
protected ESSLayer(java.lang.Object content, int type)
          Creates an ESSLayer for the given content of given type.
 
Method Summary
 java.lang.Object getContent()
          Gets the content of this ESSLayer.
 javax.activation.DataHandler getDataHandler()
          Gets the DataHandler that wraps the content of this layer, if set.
 ESSLayerException getException()
          Gets the exception that indicates a problem that has occured when parsing this layer.
 int getType()
          Gets the type of this ESS layer, either SIGNED_DATA (0) or ENVELOPED_DATA (1), or -1 (any other type).
protected  void setDataHandler(javax.activation.DataHandler dataHandler)
          Sets the DataHandler that wraps the content of this layer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIGNED_DATA

public static final int SIGNED_DATA
ESSLayer type CMS SIGNED_DATA (0).

See Also:
Constant Field Values

ENVELOPED_DATA

public static final int ENVELOPED_DATA
ESSLayer type CMS ENVELOPED_DATA (1).

See Also:
Constant Field Values

type_

protected int type_
The type of this ESS layer, either SIGNED_DATA (0) or ENVELOPED_DATA (1), or -1 (any other type). This does not represent the content type of the S/MIME message, rather it maybe used to check whether this layer is cryptographically enhnaced or not.


content_

protected java.lang.Object content_
The content of this ESSLayer. This may represent a cryptographically enhanced S/MIME entity like SignedContent or EncryptedContent, or any other MIME entity (e.g. MimeMultipart, MimeBodyPart) or content represented by an, e.g. InputStream, or String, ... .


dataHandler_

protected javax.activation.DataHandler dataHandler_
The DataHandler that may wrap the content.

Constructor Detail

ESSLayer

public ESSLayer(java.lang.Object content)
Creates an ESSLayer for the given content, which may represent a cryptographically enhanced S/MIME entity like SignedContent or EncryptedContent, or any other type of content.

Parameters:
content - the content for this ESSLayer

ESSLayer

protected ESSLayer(java.lang.Object content,
                   int type)
Creates an ESSLayer for the given content of given type. The content object may represent a cryptographically enhanced S/MIME entity like SignedContent or EncryptedContent, or any other type of content.

Parameters:
content - the content for this ESSLayer
type - the cryptograhic enhancement type, either SIGNED_DATA (0) or ENVELOPED_DATA (1), or -1 (any other type) of this layer
Method Detail

getType

public int getType()
Gets the type of this ESS layer, either SIGNED_DATA (0) or ENVELOPED_DATA (1), or -1 (any other type). This does not represent the content type of the S/MIME message, rather it maybe used to check whether this layer is cryptographically enhnaced or not.

Returns:
the cryptograhic enhancement type, either SIGNED_DATA (0) or ENVELOPED_DATA (1), or -1 (any other type) of this layer

getContent

public java.lang.Object getContent()
                            throws java.io.IOException
Gets the content of this ESSLayer.

Returns:
the content of this ESSLayer, either representing a cryptographically enhanced S/MIME entity like SignedContent or EncryptedContent, or any other MIME entity (e.g. MimeMultipart, MimeBodyPart) or content represented by an, e.g. InputStream, or String, ... .
Throws:
java.io.IOException - if an error occurs when accessing the content

getDataHandler

public javax.activation.DataHandler getDataHandler()
Gets the DataHandler that wraps the content of this layer, if set.

Returns:
the DataHandler that wraps the content of this layer, or null if there is no DataHandler

setDataHandler

protected void setDataHandler(javax.activation.DataHandler dataHandler)
Sets the DataHandler that wraps the content of this layer.

Parameters:
dataHandler - the DataHandler that wraps the content of this layer

getException

public ESSLayerException getException()
Gets the exception that indicates a problem that has occured when parsing this layer.

Returns:
the exception indicating a problem that has occured when parsing this layer; will be null if no problem has occured when parsing the layer

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

IAIK-CMS 5.1, (c) 2002 IAIK, (c) 2003 - 2010 SIC