|
IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectdemo.smime.basic.CMSStreamDemo
public class CMSStreamDemo
This class shows the usage of the SMimeSigned and SMimeEncrypted classes. These classes can be used to create/parse signed and/or encrypted CMS messages. This demo does not use the JavaMail API.
SMimeSigned,
SMimeEncrypted| Constructor Summary | |
|---|---|
CMSStreamDemo()
Empty default constructor. |
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] argv)
The main method. |
void |
setupCertificates()
Reads the required keys and certificates from the demo keystore. |
void |
start()
Starts the demo. |
void |
testSMimeAuthEncrypted(iaik.asn1.structures.AlgorithmID contentEA,
iaik.asn1.structures.AlgorithmID keyWrapAlg,
int keyLength,
int recipientIndex)
Uses class SMimeAuthEncrypted to
authenticated encrypt some data, encode it,
and finally parses the encoding to decrypt and recover the original content. |
void |
testSMimeEncrypted(iaik.asn1.structures.AlgorithmID contentEA,
iaik.asn1.structures.AlgorithmID keyWrapAlg,
int keyLength,
int recipientIndex)
Uses class SMimeEncrypted to encrypt some data, encode it,
and finally parses the encoding to decrypt and recover the original content. |
void |
testSMimeSigned(int mode)
Uses class SMimeSigned to sign some data, encode it,
and finally parses the encoding to verify the signature. |
void |
testSMimeSignedAndAuthEncrypted(iaik.asn1.structures.AlgorithmID contentEA,
iaik.asn1.structures.AlgorithmID keyWrapAlg,
int keyLength,
int recipientIndex)
Uses class SMimeSigned and class SMimeAuthEncrypted
to sign and authenticated encrypt some data, encode it, and finally parses the encoding to decrypt and recover the original content
and verify the signature. |
void |
testSMimeSignedAndEncrypted(iaik.asn1.structures.AlgorithmID contentEA,
iaik.asn1.structures.AlgorithmID keyWrapAlg,
int keyLength,
int recipientIndex)
Uses class SMimeSigned and class SMimeEncrypted
to sign and encrypt some data, encode it, and finally parses the encoding to decrypt and recover the original content
and verify the signature. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CMSStreamDemo()
| Method Detail |
|---|
public void setupCertificates()
throws java.lang.Exception
java.lang.Exception - if some error occurs when reading from the keystore
public void testSMimeEncrypted(iaik.asn1.structures.AlgorithmID contentEA,
iaik.asn1.structures.AlgorithmID keyWrapAlg,
int keyLength,
int recipientIndex)
throws java.lang.Exception
SMimeEncrypted to encrypt some data, encode it,
and finally parses the encoding to decrypt and recover the original content.
contentEA - the content encryption algorithm to be usedkeyWrapAlg - the key wrap algorithm to be used for encrypting the temporary content encryption keykeyLength - the length of the content encryption key to be created and usedrecipientIndex - the index into the recipientInfos field indicating for which recipient the message
shall be decrypted
java.lang.Exception - if some error occurs
public void testSMimeSigned(int mode)
throws java.lang.Exception
SMimeSigned to sign some data, encode it,
and finally parses the encoding to verify the signature.
mode - either implicit or
explicit to indicate
whether the content shall be included in the signature or
transmitted out-of-band
java.lang.Exception - if some error occurs
public void testSMimeAuthEncrypted(iaik.asn1.structures.AlgorithmID contentEA,
iaik.asn1.structures.AlgorithmID keyWrapAlg,
int keyLength,
int recipientIndex)
throws java.lang.Exception
SMimeAuthEncrypted to
authenticated encrypt some data, encode it,
and finally parses the encoding to decrypt and recover the original content.
contentEA - the content-authenticated encryption algorithm to be usedkeyWrapAlg - the key wrap algorithm to be used for encrypting the temporary content encryption keykeyLength - the length of the content encryption key to be created and usedrecipientIndex - the index into the recipientInfos field indicating for which recipient the message
shall be decrypted
java.lang.Exception - if some error occurs
public void testSMimeSignedAndEncrypted(iaik.asn1.structures.AlgorithmID contentEA,
iaik.asn1.structures.AlgorithmID keyWrapAlg,
int keyLength,
int recipientIndex)
throws java.lang.Exception
SMimeSigned and class SMimeEncrypted
to sign and encrypt some data, encode it, and finally parses the encoding to decrypt and recover the original content
and verify the signature.
contentEA - the content encryption algorithm to be usedkeyWrapAlg - the key wrap algorithm to be used for encrypting the temporary content encryption keykeyLength - the length of the content encryption key to be created and usedrecipientIndex - the index into the recipientInfos field indicating for which recipient the message
shall be decrypted
java.lang.Exception - if some error occurs
public void testSMimeSignedAndAuthEncrypted(iaik.asn1.structures.AlgorithmID contentEA,
iaik.asn1.structures.AlgorithmID keyWrapAlg,
int keyLength,
int recipientIndex)
throws java.lang.Exception
SMimeSigned and class SMimeAuthEncrypted
to sign and authenticated encrypt some data, encode it, and finally parses the encoding to decrypt and recover the original content
and verify the signature.
contentEA - the content-authenticated encryption algorithm to be usedkeyWrapAlg - the key wrap algorithm to be used for encrypting the temporary content encryption keykeyLength - the length of the content encryption key to be created and usedrecipientIndex - the index into the recipientInfos field indicating for which recipient the message
shall be decrypted
java.lang.Exception - if some error occurspublic void start()
public static void main(java.lang.String[] argv)
throws java.io.IOException
java.io.IOException
|
IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
|
v6.1 (c) 2002 IAIK, (c) 2003 - 2025 SIC |
|