|
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.ecc.SMimeEccDemo
public class SMimeEccDemo
This class demonstrates the usage of the IAIK S/MIME implementation to create ECDSA (with SHA1, SHA224, SHA256, SHA384, SHA512, RIPEMD160) signed and/or ECDH based encrypted S/MIMEv3 messages and how to parse them and verify the signatures and decrypt the content, respectively.
Any keys/certificates required for this demo are read from a keystore
file "cmsecc.keystore" located in your current working directory. If
the keystore file does not exist you can create it by running the
SetupCMSEccKeyStore
program.
Additionally to iaik_cms.jar you also must have
iaik_jce_(full).jar (IAIK-JCE,
https://sic.tech/products/core-crypto-toolkits/jca-jce/),
and iaik_eccelarate.jar (IAIK-ECCelerateTM,
https://sic.tech/products/core-crypto-toolkits/eccelerate/)
in your classpath.
To run this demo the following packages are required:
iaik_cms.jar
iaik_jce(_full).jar (IAIK-JCE Core Crypto Library).
iaik_eccelerate.jar (IAIK ECC Library).
mail.jar (JavaMail API).
activation.jar (Java Activation Framework; required for JDK versions < 1.6).
SetupCMSEccKeyStore,
SignedContent,
EncryptedContent| Constructor Summary | |
|---|---|
SMimeEccDemo()
Default constructor. |
|
| Method Summary | |
|---|---|
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 |
createSignedAndEncryptedMessage(javax.mail.Session session,
javax.activation.DataHandler dataHandler,
boolean implicit,
iaik.asn1.structures.AlgorithmID hashAlgorithm,
iaik.asn1.structures.AlgorithmID signatureAlgorithm)
Creates a signed and encrypted message. |
javax.mail.Message |
createSignedMessage(javax.mail.Session session,
javax.activation.DataHandler dataHandler,
boolean implicit,
iaik.asn1.structures.AlgorithmID hashAlgorithm,
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 SMimeEccDemo()
| 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 sessionsubject - the subject of the message
javax.mail.MessagingException - if the message cannot be created
public javax.mail.Message createSignedAndEncryptedMessage(javax.mail.Session session,
javax.activation.DataHandler dataHandler,
boolean implicit,
iaik.asn1.structures.AlgorithmID hashAlgorithm,
iaik.asn1.structures.AlgorithmID signatureAlgorithm)
throws javax.mail.MessagingException
session - the mail sessiondataHandler - the content of the message to be signed and encryptedimplicit - whether to use implicit (application/pkcs7-mime) or explicit
(multipart/signed) signinghashAlgorithm - the hash 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 createSignedMessage(javax.mail.Session session,
javax.activation.DataHandler dataHandler,
boolean implicit,
iaik.asn1.structures.AlgorithmID hashAlgorithm,
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) signinghashAlgorithm - the hash 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 used
javax.mail.MessagingException - if an error occurs when creating the message
public static void main(java.lang.String[] argv)
throws java.lang.Exception
java.lang.Exception
|
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 |
|