IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

demo.cms.signedAndEnvelopedData
Class SignedAndEnvelopedDataOutputStreamDemo

java.lang.Object
  extended by demo.cms.signedAndEnvelopedData.SignedAndEnvelopedDataOutputStreamDemo

public class SignedAndEnvelopedDataOutputStreamDemo
extends java.lang.Object

This class shows the sequential combination of the SignedDataOutputStream and EnvelopedDataOutputStream implementations.

All keys and certificates are read from a keystore created by the SetupCMSKeyStore program.


Constructor Summary
SignedAndEnvelopedDataOutputStreamDemo()
          Setup the demo certificate chains.
 
Method Summary
static void main(java.lang.String[] argv)
          Main method.
 void start()
          Starts the test.
 void testSignedAndEnvelopedDataStream(byte[] message)
          Signs and envelopes the given message, encodes the CMS object, decodes it again, removes the envlope and verifies the signature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignedAndEnvelopedDataOutputStreamDemo

public SignedAndEnvelopedDataOutputStreamDemo()
                                       throws java.io.IOException
Setup the demo certificate chains. Keys and certificate are retrieved from the demo KeyStore.

Throws:
java.io.IOException - if an file read error occurs
Method Detail

testSignedAndEnvelopedDataStream

public void testSignedAndEnvelopedDataStream(byte[] message)
                                      throws java.lang.Exception
Signs and envelopes the given message, encodes the CMS object, decodes it again, removes the envlope and verifies the signature.

Parameters:
message - the message to be signed and enveloped
Throws:
java.lang.Exception - if an error occurs

start

public void start()
Starts the test.


main

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

Throws:
java.io.IOException - if an I/O error occurs when reading required keys and certificates from files
java.lang.Exception

IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

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