IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

demo.cms.pkcs7cms
Class PKCS7CMSDataDemo

java.lang.Object
  extended by demo.cms.pkcs7cms.PKCS7CMSDataDemo

public class PKCS7CMSDataDemo
extends java.lang.Object

Compares the usage of IAIK CMS Data(Stream) with IAIK PKCS7 Data(Stream).


Constructor Summary
PKCS7CMSDataDemo()
          Default constructor.
 
Method Summary
 iaik.asn1.ASN1Object createData(byte[] message)
          Creates a CMS Data object.
 byte[] createDataStream(byte[] message)
          Creates a CMS Data object.
 iaik.asn1.ASN1Object createPKCS7Data(byte[] message)
          Creates a PKCS#7 Data object.
 byte[] createPKCS7DataStream(byte[] message)
          Creates a PKCS#7 Data object.
 byte[] getData(iaik.asn1.ASN1Object asn1Object)
          Parses a CMS Data object.
 byte[] getDataStream(byte[] data)
          Parses a CMS Data object.
 byte[] getPKCS7Data(iaik.asn1.ASN1Object asn1Object)
          Parses a PKCS#7 Data object.
 byte[] getPKCS7DataStream(byte[] data)
          Parses a PKCS#7 Data object.
static void main(java.lang.String[] argv)
          Starts the CMS - PKCS#7 tests.
 void start()
          Tests IAIK CMS Data(Stream) against IAIK PKCS7 Data(Stream).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PKCS7CMSDataDemo

public PKCS7CMSDataDemo()
Default constructor.

Method Detail

createDataStream

public byte[] createDataStream(byte[] message)
                        throws iaik.cms.CMSException,
                               java.io.IOException
Creates a CMS Data object.

Parameters:
message - the message to be sent, as byte representation
Returns:
the DER encoding of the Data object just created
Throws:
iaik.cms.CMSException - if the Data object cannot be created
java.io.IOException - if an I/O error occurs

getDataStream

public byte[] getDataStream(byte[] data)
                     throws iaik.cms.CMSException,
                            java.io.IOException
Parses a CMS Data object.

Parameters:
data - the Data object as DER encoded byte array
Returns:
the inherent message as byte array
Throws:
iaik.cms.CMSException - if an parsing exception occurs
java.io.IOException - if an I/O error occurs

createData

public iaik.asn1.ASN1Object createData(byte[] message)
                                throws iaik.cms.CMSException,
                                       java.io.IOException
Creates a CMS Data object.

Parameters:
message - the message to be sent, as byte representation
Returns:
the ASN.1 representation of the Data object just created
Throws:
iaik.cms.CMSException - if the Data object cannot be created
java.io.IOException - if an I/O error occurs

getData

public byte[] getData(iaik.asn1.ASN1Object asn1Object)
               throws iaik.cms.CMSException,
                      java.io.IOException
Parses a CMS Data object.

Parameters:
asn1Object - the Data object as ASN.1 object
Returns:
the inherent message as byte array
Throws:
iaik.cms.CMSException - if an parsing exception occurs
java.io.IOException - if an I/O error occurs

createPKCS7DataStream

public byte[] createPKCS7DataStream(byte[] message)
                             throws iaik.pkcs.PKCSException,
                                    java.io.IOException
Creates a PKCS#7 Data object.

Parameters:
message - the message to be sent, as byte representation
Returns:
the DER encoding of the Data object just created
Throws:
iaik.pkcs.PKCSException - if the Data object cannot be created
java.io.IOException - if an I/O error occurs

getPKCS7DataStream

public byte[] getPKCS7DataStream(byte[] data)
                          throws iaik.pkcs.PKCSException,
                                 java.io.IOException
Parses a PKCS#7 Data object.

Parameters:
data - the Data object as DER encoded byte array
Returns:
the inherent message as byte array, or null if there is no message included into the supplied data object
Throws:
iaik.pkcs.PKCSException - if an parsing exception occurs
java.io.IOException - if an I/O error occurs

createPKCS7Data

public iaik.asn1.ASN1Object createPKCS7Data(byte[] message)
                                     throws iaik.pkcs.PKCSException,
                                            java.io.IOException
Creates a PKCS#7 Data object.

Parameters:
message - the message to be sent, as byte representation
Returns:
the ASN.1 representation of the Data object just created
Throws:
iaik.pkcs.PKCSException - if the Data object cannot be created
java.io.IOException - if an I/O error occurs

getPKCS7Data

public byte[] getPKCS7Data(iaik.asn1.ASN1Object asn1Object)
                    throws iaik.pkcs.PKCSException,
                           java.io.IOException
Parses a PKCS#7 Data object.

Parameters:
asn1Object - the Data object as ASN.1 object
Returns:
the inherent message as byte array
Throws:
iaik.pkcs.PKCSException - if an parsing exception occurs
java.io.IOException - if an IOException occurs

start

public void start()
Tests IAIK CMS Data(Stream) against IAIK PKCS7 Data(Stream).


main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Starts the CMS - PKCS#7 tests.

Throws:
java.lang.Exception

IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

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