|
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.cms.pkcs11.PKCS11Demo
demo.smime.pkcs11.SignedMailDemo
public abstract class SignedMailDemo
Base class of signed mail demos using PKCS#11 for accessing the signer key on a smart card.
Field Summary | |
---|---|
protected java.lang.String |
recipient_
The email address of the recipient. |
protected java.lang.String |
sender_
The email address of the sender. |
protected iaik.x509.X509Certificate[] |
signerCertificates_
The certificate chain of the signer. |
protected java.security.PrivateKey |
signerKey_
The private key of the signer. |
Fields inherited from class demo.cms.pkcs11.PKCS11Demo |
---|
iaikPkcs11Provider_, iaikSoftwareProvider_, moduleName_, tokenKeyStore_, userPin_ |
Constructor Summary | |
---|---|
protected |
SignedMailDemo(java.lang.String moduleName,
char[] userPin)
Creates a SignedMailDemo object for the given module name. |
Method Summary | |
---|---|
protected javax.mail.internet.MimeMessage |
createSignedMessage(javax.mail.Session session,
javax.activation.DataHandler dataHandler,
boolean implicit)
Creates a signed message. |
protected void |
getSignatureKey()
This method gets the key stores of all inserted (compatible) smart cards and simply takes the first key-entry. |
protected void |
start(boolean implicit)
Starts the demo. |
Methods inherited from class demo.cms.pkcs11.PKCS11Demo |
---|
getKeyStore, init |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.security.PrivateKey signerKey_
protected iaik.x509.X509Certificate[] signerCertificates_
protected java.lang.String sender_
protected java.lang.String recipient_
Constructor Detail |
---|
protected SignedMailDemo(java.lang.String moduleName, char[] userPin)
moduleName
- the name of the moduleuserPin
- the user-pin (password) for the TokenKeyStore
(may be null
to pou-up a dialog asking for the pin)Method Detail |
---|
protected void getSignatureKey() throws java.security.GeneralSecurityException, java.io.IOException
signerKey_
and signerCertificate_
.
java.security.GeneralSecurityException
- If anything with the provider fails.
java.io.IOException
- If loading the key store fails.protected javax.mail.internet.MimeMessage createSignedMessage(javax.mail.Session session, javax.activation.DataHandler dataHandler, boolean implicit) 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) signing
javax.mail.MessagingException
- if an error occurs when creating the messageprotected void start(boolean implicit) throws java.lang.Exception
implicit
- whether to create an implicit (content included;
application/pkcs7-mime) or an explicit (content
not included; multipart/signed) signed message
java.lang.Exception
- if an error occurs
|
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 |
![]() |