Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

hk.hku.cecid.phoenix.pki
Class SMIMEDecrypter  view SMIMEDecrypter download SMIMEDecrypter.java

java.lang.Object
  extended byhk.hku.cecid.phoenix.pki.SMIMEHandler
      extended byhk.hku.cecid.phoenix.pki.SMIMEDecrypter

public class SMIMEDecrypter
extends SMIMEHandler

A class for decrypting MimeBodyPart that was encrypted by SMIME.


Field Summary
private  CompositeKeyStore compositeKs
           
private static SMIMEDecrypter instance
           
static java.lang.String SMIME_ENCRYPTED
           
 
Fields inherited from class hk.hku.cecid.phoenix.pki.SMIMEHandler
 
Constructor Summary
protected SMIMEDecrypter(java.lang.String keyStorePath, java.lang.String keyStorePass)
          Constructor.
 
Method Summary
 javax.mail.internet.MimeMessage decryptMimeMessage(java.lang.String alias, java.lang.String keyPass, javax.mail.internet.MimeMessage mimeMessage, javax.mail.Session session)
          Decrypts a MimeBodyPart that was encrypted by SMIME.
static SMIMEDecrypter getInstance(java.lang.String keyStorePath, java.lang.String keyStorePass)
          The application should use this method to get a instance of SMIMEDecrypter
 boolean isSMIMEEncrypted(javax.mail.internet.MimeMessage mimeMessage)
          It returns whether the MimeBodyPart is encrypted by SMIME.
 
Methods inherited from class hk.hku.cecid.phoenix.pki.SMIMEHandler
initiate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static SMIMEDecrypter instance

compositeKs

private CompositeKeyStore compositeKs

SMIME_ENCRYPTED

public static final java.lang.String SMIME_ENCRYPTED
See Also:
Constant Field Values
Constructor Detail

SMIMEDecrypter

protected SMIMEDecrypter(java.lang.String keyStorePath,
                         java.lang.String keyStorePass)
Constructor.

Method Detail

getInstance

public static SMIMEDecrypter getInstance(java.lang.String keyStorePath,
                                         java.lang.String keyStorePass)
The application should use this method to get a instance of SMIMEDecrypter


decryptMimeMessage

public javax.mail.internet.MimeMessage decryptMimeMessage(java.lang.String alias,
                                                          java.lang.String keyPass,
                                                          javax.mail.internet.MimeMessage mimeMessage,
                                                          javax.mail.Session session)
                                                   throws java.security.KeyStoreException,
                                                          java.security.NoSuchAlgorithmException,
                                                          java.security.UnrecoverableKeyException,
                                                          SMIMEException
Decrypts a MimeBodyPart that was encrypted by SMIME.


isSMIMEEncrypted

public boolean isSMIMEEncrypted(javax.mail.internet.MimeMessage mimeMessage)
                         throws javax.mail.MessagingException
It returns whether the MimeBodyPart is encrypted by SMIME. Note that it only checks whether the content type string starts with "application/pkcs7-mime", it does not tell whether the MimeBodyPart can be correctly decrypted.