IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

demo.cms.signedAndEnvelopedData
Class SignedAndEnvelopedDataDemo

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

public class SignedAndEnvelopedDataDemo
extends java.lang.Object

This class shows the sequential combination of the SignedData and EnvelopedData implementations.

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


Constructor Summary
SignedAndEnvelopedDataDemo()
          Setup the demo certificate chains.
 
Method Summary
static void main(java.lang.String[] argv)
          Main method.
 void start()
          Starts the test.
 void testSignedAndEnvelopedData(byte[] message)
          Uses the non-stream based SignedData and EnvelopedData implementations (SignedData, EnvelopedData to sign and envelope the given message, encode the CMS object, decodes it again, removes the envlope and verifies the signature.
 void testSignedAndEnvelopedDataStream(byte[] message)
          Uses the stream based SignedData and EnvelopedData implementations (SignedDataStream, EnvelopedDataStream to sign and envelope the given message, encode 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

SignedAndEnvelopedDataDemo

public SignedAndEnvelopedDataDemo()
                           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
Uses the stream based SignedData and EnvelopedData implementations (SignedDataStream, EnvelopedDataStream to sign and envelope the given message, encode 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

testSignedAndEnvelopedData

public void testSignedAndEnvelopedData(byte[] message)
                                throws java.lang.Exception
Uses the non-stream based SignedData and EnvelopedData implementations (SignedData, EnvelopedData to sign and envelope the given message, encode 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