|
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.ess.SecurityLabelDemo
public class SecurityLabelDemo
Demonstrates the usage of the S/MIME-ESS SecurityLabel attribute.
The SecurityLabel attribute may be
included as signed attribute in a SignerInfo for
providing some kind of "access control" mechanism for the contents of a message.
This demo uses a simple SecurityLabelHandler that only implements a simple security policy based on
the default security classifications "unmarked", "unclassified", "restricted",
"confidential", "secret", "top-secret". Since the SignedData message created
by this demo only contains an ESS SecurityLabel attribute with classification "confidential", only this
classification is processed by the demo handler. "unmarked" and "unclassified" are handled as "not critical"
content (i.e. the content can be accessed by any one), "secret", "top-secret"
lock the content (i.e. it is not displayed), and "restricted" and
"confidential" popup a confirmation dialog reminding the recipient about
the confidentiality of the message content.
To run this demo the following packages are required:
iaik_cms.jar
iaik_jce(_full).jar (IAIK-JCE Core Crypto Library).
mail.jar (JavaMail API).
activation.jar (Java Activation Framework; required for JDK versions < 1.6).
MySecurityLabelHandler,
ESSSecurityLabel| Constructor Summary | |
|---|---|
SecurityLabelDemo()
Default constructor. |
|
| Method Summary | |
|---|---|
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 |
createSignedMessage(javax.mail.Session session)
Creates a signed message containing an ESS SecurityLabel attribute. |
static void |
main(java.lang.String[] argv)
The main method. |
void |
parseMessage(javax.mail.Message msg)
Parses the signed message, verifies the signature and processes the SecurityLabel attribute. |
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 SecurityLabelDemo()
| 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 createSignedMessage(javax.mail.Session session)
throws java.lang.Exception
session - the mail session
java.lang.Exception - if an error occurs when creating the message
public void parseMessage(javax.mail.Message msg)
throws java.io.IOException,
javax.mail.MessagingException,
java.security.SignatureException
msg - the message to be parsed
java.io.IOException - if an I/O related problem occurs
javax.mail.MessagingException - if there is a problem with the message format
java.security.SignatureException - if the signature verification failes
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 |
|