com.dstc.security.smime
Class SMIMEUtil

java.lang.Object
  |
  +--com.dstc.security.smime.SMIMEUtil

public final class SMIMEUtil
extends Object

A utility class for S/MIME message processing


Method Summary
static String[] getEmailAddress(X509Certificate cert)
          Returns the distinct e-mail address(es) in the supplied certificate, or an empty array if absent.
static boolean isEncrypted(MimeMessage msg)
          Returns true if the specified MimeMessage is encrypted at the top-most level.
static boolean isSigned(MimeMessage msg)
          Returns true if the specified MimeMessage is signed at the top-most level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isEncrypted

public static boolean isEncrypted(MimeMessage msg)
                           throws MessagingException
Returns true if the specified MimeMessage is encrypted at the top-most level. This method simply checks the mime type for the MimeMessage.

isSigned

public static boolean isSigned(MimeMessage msg)
                        throws MessagingException
Returns true if the specified MimeMessage is signed at the top-most level. This method simply checks the mime type for the MimeMessage.

getEmailAddress

public static String[] getEmailAddress(X509Certificate cert)
Returns the distinct e-mail address(es) in the supplied certificate, or an empty array if absent.