|
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.SMimeV3Demo
public class SMimeV3Demo
This class demonstrates the usage of the IAIK S/MIME implementation. It shows how to create signed and/or encrypted S/MIMEv3 messages and how to parse them and verify the signatures and decrypt the content, respectively.
To run this demo the following packages are required:
iaik_cms.jar (IAIK-CMS/SMIME)
iaik_jce(_full).jar (IAIK-JCE Core Crypto Library).
mail.jar (JavaMail API).
activation.jar (Java Activation Framework; required for JDK versions < 1.6).
iaik_esdh.jar or
iaik_jce_full.jar; the first may be used in addition to iaik_jce.jar,
the second instead of iaik_jce.jar.
| Constructor Summary | |
|---|---|
SMimeV3Demo()
Default constructor. |
|
| Method Summary | |
|---|---|
javax.mail.Message |
createAuthEncryptedMessage(javax.mail.Session session,
iaik.asn1.structures.AlgorithmID contentEA,
int keyLength,
iaik.asn1.structures.AlgorithmID keyEA,
iaik.asn1.structures.AlgorithmID keyWrapAlgorithm,
int kekLength)
Creates an authenticated encrypted message. |
javax.mail.Message |
createCertsOnlyMessage(javax.mail.Session session)
Creates a certs-only message. |
javax.mail.Message |
createCertsOnlyMultiPartMessage(javax.mail.Session session)
Creates a certs-only message where the certificate list is transferred as attachment. |
javax.mail.Message |
createCompressedMessage(javax.mail.Session session,
javax.activation.DataHandler dataHandler,
iaik.asn1.structures.AlgorithmID algorithm)
Creates a compressed message. |
javax.mail.Message |
createEncryptedMessage(javax.mail.Session session,
iaik.asn1.structures.AlgorithmID contentEA,
int keyLength,
iaik.asn1.structures.AlgorithmID keyEA,
iaik.asn1.structures.AlgorithmID keyWrapAlgorithm,
int kekLength)
Creates an encrypted message. |
javax.mail.Message |
createMessage(javax.mail.Session session,
java.lang.String subject)
Creates a MIME message container with the given subject for the given session. |
javax.mail.Message |
createPKCS10Message(javax.mail.Session session)
Creates a PKCS#10 certificate request message. |
javax.mail.Message |
createPKCS10MultiPartMessage(javax.mail.Session session)
Creates a PKCS#10 message where the certificate request is transferred as attachment. |
javax.mail.Message |
createPlainMessage(javax.mail.Session session,
javax.activation.DataHandler dataHandler)
Creates a simple plain (neither signed nor encrypted) message. |
javax.mail.Message |
createSignedAndEncryptedMessage(javax.mail.Session session,
iaik.asn1.structures.AlgorithmID algorithm,
javax.activation.DataHandler dataHandler,
boolean implicit)
Creates a signed and encrypted message. |
javax.mail.Message |
createSignedMessage(javax.mail.Session session,
javax.activation.DataHandler dataHandler,
boolean implicit,
iaik.asn1.structures.AlgorithmID digestAlgorithm,
iaik.asn1.structures.AlgorithmID signatureAlgorithm)
Creates a signed message. |
static void |
main(java.lang.String[] argv)
The main method. |
void |
start()
Starts the demo. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SMimeV3Demo()
| Method Detail |
|---|
public void start()
throws java.io.IOException
java.io.IOException - if an I/O related error occurs
public javax.mail.Message createMessage(javax.mail.Session session,
java.lang.String subject)
throws javax.mail.MessagingException
session - the mail sesionsubject - the subject of the message
javax.mail.MessagingException - if the message cannot be created
public javax.mail.Message createPlainMessage(javax.mail.Session session,
javax.activation.DataHandler dataHandler)
throws javax.mail.MessagingException
session - the mail sessiondataHandler - the content of the message
javax.mail.MessagingException - if an error occurs when creating the message
public javax.mail.Message createSignedAndEncryptedMessage(javax.mail.Session session,
iaik.asn1.structures.AlgorithmID algorithm,
javax.activation.DataHandler dataHandler,
boolean implicit)
throws javax.mail.MessagingException
session - the mail sessionalgorithm - the content encryption algorithm to be useddataHandler - the content of the message to be signed and encryptedimplicit - whether to use implicit (application/pkcs7-mime) or explicit
(multipart/signed) signing
javax.mail.MessagingException - if an error occurs when creating the message
public javax.mail.Message createSignedMessage(javax.mail.Session session,
javax.activation.DataHandler dataHandler,
boolean implicit,
iaik.asn1.structures.AlgorithmID digestAlgorithm,
iaik.asn1.structures.AlgorithmID signatureAlgorithm)
throws javax.mail.MessagingException
session - the mail sessiondataHandler - the content of the message to be signedimplicit - whether to use implicit (application/pkcs7-mime) or explicit
(multipart/signed) signingdigestAlgorithm - the digest algorithm to be usedsignatureAlgorithm - the signature algorithm to be used
javax.mail.MessagingException - if an error occurs when creating the message
public javax.mail.Message createEncryptedMessage(javax.mail.Session session,
iaik.asn1.structures.AlgorithmID contentEA,
int keyLength,
iaik.asn1.structures.AlgorithmID keyEA,
iaik.asn1.structures.AlgorithmID keyWrapAlgorithm,
int kekLength)
throws javax.mail.MessagingException
session - the mail sessioncontentEA - the content encryption algorithm to be usedkeyLength - the length of the secret content encryption key to be created and usedkeyEA - the key encryption algorithm to be usedkeyWrapAlgorithm - the key wrap algorithm to be usedkekLength - the length of the key encryption algorithm
javax.mail.MessagingException - if an error occurs when creating the message
public javax.mail.Message createAuthEncryptedMessage(javax.mail.Session session,
iaik.asn1.structures.AlgorithmID contentEA,
int keyLength,
iaik.asn1.structures.AlgorithmID keyEA,
iaik.asn1.structures.AlgorithmID keyWrapAlgorithm,
int kekLength)
throws javax.mail.MessagingException
session - the mail sessioncontentEA - the content encryption algorithm to be usedkeyLength - the length of the secret content encryption key to be created and usedkeyEA - the key encryption algorithm to be usedkeyWrapAlgorithm - the key wrap algorithm to be usedkekLength - the length of the key encryption algorithm
javax.mail.MessagingException - if an error occurs when creating the message
public javax.mail.Message createCertsOnlyMessage(javax.mail.Session session)
throws javax.mail.MessagingException
session - the mail session
javax.mail.MessagingException - if an error occurs when creating the message
public javax.mail.Message createCertsOnlyMultiPartMessage(javax.mail.Session session)
throws javax.mail.MessagingException
session - the mail session
javax.mail.MessagingException - if an error occurs when creating the message
public javax.mail.Message createCompressedMessage(javax.mail.Session session,
javax.activation.DataHandler dataHandler,
iaik.asn1.structures.AlgorithmID algorithm)
throws javax.mail.MessagingException
session - the mail sessiondataHandler - the datahandler supplying the content to be compressedalgorithm - the compression algorithm to be used
javax.mail.MessagingException - if an error occurs when creating the message
public javax.mail.Message createPKCS10Message(javax.mail.Session session)
throws javax.mail.MessagingException
session - the mail session
javax.mail.MessagingException - if an error occurs when creating the message
public javax.mail.Message createPKCS10MultiPartMessage(javax.mail.Session session)
throws javax.mail.MessagingException
session - the mail session
javax.mail.MessagingException - if an error occurs when creating the message
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 |
|