Class ValidateSignedMail


  • public class ValidateSignedMail
    extends java.lang.Object
    An Example that reads a signed mail and validates its signature. Also validating the certificate path from the signers key to a trusted entity
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DETAIL  
      static int SUMMARY  
      static int TEXT  
      static int TITLE  
      static boolean useCaCerts  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      protected static java.security.cert.TrustAnchor getTrustAnchor​(java.lang.String trustcert)  
      protected static java.security.cert.X509Certificate loadCert​(java.lang.String certfile)  
      protected static java.security.cert.X509CRL loadCRL​(java.lang.String crlfile)  
      static void main​(java.lang.String[] args)  
      static void verifySignedMail​(javax.mail.internet.MimeMessage msg, java.security.cert.PKIXParameters param)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ValidateSignedMail

        public ValidateSignedMail()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • verifySignedMail

        public static void verifySignedMail​(javax.mail.internet.MimeMessage msg,
                                            java.security.cert.PKIXParameters param)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTrustAnchor

        protected static java.security.cert.TrustAnchor getTrustAnchor​(java.lang.String trustcert)
                                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • loadCert

        protected static java.security.cert.X509Certificate loadCert​(java.lang.String certfile)
      • loadCRL

        protected static java.security.cert.X509CRL loadCRL​(java.lang.String crlfile)