chapter9
Class Utils

java.lang.Object
  extended by chapter2.Utils
      extended by chapter3.Utils
          extended by chapter4.Utils
              extended by chapter5.Utils
                  extended by chapter6.Utils
                      extended by chapter7.Utils
                          extended by chapter8.Utils
                              extended by chapter9.Utils
Direct Known Subclasses:
Utils

public class Utils
extends Utils

Chapter 9 Utils


Field Summary
static char[] KEY_PASSWD
           
 
Fields inherited from class chapter8.Utils
END_ENTITY_ALIAS, INTERMEDIATE_ALIAS, ROOT_ALIAS
 
Constructor Summary
Utils()
           
 
Method Summary
static java.security.cert.PKIXCertPathBuilderResult buildPath(java.security.cert.X509Certificate rootCert, java.security.cert.X509CertSelector endConstraints, java.security.cert.CertStore certsAndCRLs)
          Build a path using the given root as the trust anchor, and the passed in end constraints and certificate store.
static java.security.KeyStore createCredentials()
          Create a KeyStore containing the a private credential with certificate chain and a trust anchor.
static javax.mail.internet.MimeMessage createMimeMessage(java.lang.String subject, java.lang.Object content, java.lang.String contentType)
          Create a MIME message from using the passed in content.
 
Methods inherited from class chapter8.Utils
createEndEntityCredential, createIntermediateCredential, createRootCredential
 
Methods inherited from class chapter7.Utils
generateEndEntityCert, generateIntermediateCert, generateRootCert
 
Methods inherited from class chapter6.Utils
generateRSAKeyPair
 
Methods inherited from class chapter4.Utils
createFixedRandom
 
Methods inherited from class chapter3.Utils
createCtrIvForAES, createKeyForAES, toByteArray, toString, toString
 
Methods inherited from class chapter2.Utils
toHex, toHex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_PASSWD

public static char[] KEY_PASSWD
Constructor Detail

Utils

public Utils()
Method Detail

createCredentials

public static java.security.KeyStore createCredentials()
                                                throws java.lang.Exception
Create a KeyStore containing the a private credential with certificate chain and a trust anchor.

Throws:
java.lang.Exception

buildPath

public static java.security.cert.PKIXCertPathBuilderResult buildPath(java.security.cert.X509Certificate rootCert,
                                                                     java.security.cert.X509CertSelector endConstraints,
                                                                     java.security.cert.CertStore certsAndCRLs)
                                                              throws java.lang.Exception
Build a path using the given root as the trust anchor, and the passed in end constraints and certificate store.

Note: the path is built with revocation checking turned off.

Throws:
java.lang.Exception

createMimeMessage

public static javax.mail.internet.MimeMessage createMimeMessage(java.lang.String subject,
                                                                java.lang.Object content,
                                                                java.lang.String contentType)
                                                         throws javax.mail.MessagingException
Create a MIME message from using the passed in content.

Throws:
javax.mail.MessagingException


Examples from "Beginning Cryptography with Java"