IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

demo.smime.ess
Class TripleWrappingDemo

java.lang.Object
  extended by demo.smime.ess.TripleWrappingDemo

public class TripleWrappingDemo
extends java.lang.Object

An ESS triple wrapping demo. Creates a RFC2634 ESS triple wrapped (signed - encrypted - signed) message and subsequently parses it to decrypt the layer and verify the signatures.

To run this demo the following packages are required:

See Also:
EncryptedContent, SignedContent

Constructor Summary
TripleWrappingDemo()
          Empty default constructor.
 
Method Summary
 javax.mail.Message createMessage(javax.mail.Session session, java.lang.String subject)
          Creates a MIME message container with the given subject for the given session.
static void main(java.lang.String[] argv)
          Main method.
 void start()
          Starts the demo.
 javax.mail.Message tripleWrap(javax.mail.Session session, javax.activation.DataHandler dataHandler, boolean innerImplicit, boolean outerImplicit, boolean differentOuterSigner)
          Creates a triple wrapped (signed - encrypted - signed) message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TripleWrappingDemo

public TripleWrappingDemo()
Empty default constructor. Reads all required keys and certificates from the demo keystore (created by running @link demo.keystore.SetupCMSKeySrore) stored at "cms.keystore" in your current working directoy.

Method Detail

start

public void start()
           throws java.io.IOException
Starts the demo.

Throws:
java.io.IOException - if an I/O related error occurs

createMessage

public javax.mail.Message createMessage(javax.mail.Session session,
                                        java.lang.String subject)
                                 throws javax.mail.MessagingException
Creates a MIME message container with the given subject for the given session.

Parameters:
session - the mail sesion
subject - the subject of the message
Returns:
the MIME message with FROM, TO, DATE and SUBJECT headers (without content)
Throws:
javax.mail.MessagingException - if the message cannot be created

tripleWrap

public javax.mail.Message tripleWrap(javax.mail.Session session,
                                     javax.activation.DataHandler dataHandler,
                                     boolean innerImplicit,
                                     boolean outerImplicit,
                                     boolean differentOuterSigner)
                              throws java.lang.Exception
Creates a triple wrapped (signed - encrypted - signed) message.

Parameters:
session - the Session
dataHandler - the data handler providing the raw content
innerImplicit - whether to sign the inner content implicitly or explicitly
outerImplicit - whether to sign the outer content implicitly or explicitly
differentOuterSigner - whether to simulate a different outer signer receiving the signed and encrypted message and adding an outer layer
Returns:
the triple wrapped message
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] argv)
                 throws java.io.IOException
Main method.

Throws:
java.io.IOException

IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

v6.1
(c) 2002 IAIK, (c) 2003 - 2025 SIC