IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

demo.cms.data
Class DataDemo

java.lang.Object
  extended by demo.cms.data.DataDemo

public class DataDemo
extends java.lang.Object

Shows the usage of the IAIK-CMS Data(Stream) implementation.


Constructor Summary
DataDemo()
          Default constructor.
 
Method Summary
 byte[] createData(byte[] message)
          Creates a CMS Data object.
 byte[] createDataStream(byte[] message)
          Creates a CMS Data object.
 byte[] getData(byte[] encoding)
          Parses a CMS Data object.
 byte[] getDataStream(byte[] data)
          Parses a CMS Data object.
static void main(java.lang.String[] argv)
          Main method.
 void start()
          Tests IAIK CMS Data(Stream).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataDemo

public DataDemo()
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 BER 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 BER encoded byte array
Returns:
the inherent content as byte array
Throws:
iaik.cms.CMSException - if an parsing exception occurs
java.io.IOException - if an I/O error occurs

createData

public byte[] 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 the DER encoded 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(byte[] encoding)
               throws iaik.cms.CMSException,
                      java.io.IOException
Parses a CMS Data object.

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

start

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


main

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

Throws:
java.lang.Exception

IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

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