IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

demo.cms.data
Class DataOutputStreamDemo

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

public class DataOutputStreamDemo
extends java.lang.Object

Demonstrates the usage of class DataOutputStream.


Constructor Summary
DataOutputStreamDemo()
          Default constructor.
 
Method Summary
 byte[] createData(byte[] message)
          Uses the IAIK-CMS DataOutputStream class to encode the given data.
 byte[] getData(byte[] data)
          Parses a CMS Data object.
static void main(java.lang.String[] argv)
          Main method.
 void start()
          Starts the tests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataOutputStreamDemo

public DataOutputStreamDemo()
                     throws java.io.IOException
Default constructor.

Throws:
java.io.IOException
Method Detail

createData

public byte[] createData(byte[] message)
                  throws iaik.cms.CMSException,
                         java.io.IOException
Uses the IAIK-CMS DataOutputStream class to encode the given data.

Parameters:
message - the message to be encoded, as byte representation
Returns:
the BER encoding of the Data object just created, wrapped in a ContentInfo
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[] 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

start

public void start()
Starts the tests.


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