|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcybervillains.ca.KeyStoreManager
public class KeyStoreManager
This is the main entry point into the Cybervillains CA. This class handles generation, storage and the persistent mapping of input to duplicated certificates and mapped public keys. Default setting is to immediately persist changes to the store by writing out the keystore and mapping file every time a new certificate is added. This behavior can be disabled if desired, to enhance performance or allow temporary testing without modifying the certificate store. Copyright (c) 2007, Information Security Partners, LLC All rights reserved. In a special exception, Selenium/OpenQA is allowed to use this code under the Apache License 2.0.
Field Summary | |
---|---|
static String |
_caPrivKeyAlias
|
KeyPairGenerator |
_dsaKpg
|
KeyPairGenerator |
_rsaKpg
|
String |
DSA_KEYGEN_ALGO
|
String |
RSA_KEYGEN_ALGO
|
Constructor Summary | |
---|---|
KeyStoreManager(File root,
String certificateRevocationList)
|
Method Summary | |
---|---|
void |
addCertAndPrivateKey(String hostname,
X509Certificate cert,
PrivateKey privKey)
Stores a new certificate and its associated private key in the keystore. |
protected void |
createKeystore()
Creates, writes and loads a new keystore and CA root certificate. |
X509Certificate |
getCertificateByAlias(String alias)
Returns the aliased certificate. |
X509Certificate |
getCertificateByHostname(String hostname)
Returns the aliased certificate. |
KeyStore |
getKeyStore()
|
X509Certificate |
getMappedCertificateForHostname(String hostname)
This method returns the mapped certificate for a hostname, or generates a "standard" SSL server certificate issued by the CA to the supplied subject if no mapping has been created. |
KeyPair |
getRSAKeyPair()
Generate an RSA Key Pair |
X509Certificate |
getSigningCert()
Gets the authority root signing cert. |
PrivateKey |
getSigningPrivateKey()
Gets the authority private signing key. |
void |
persist()
Writes the keystore and certificate/keypair mappings to disk. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String _caPrivKeyAlias
public final String RSA_KEYGEN_ALGO
public final String DSA_KEYGEN_ALGO
public final KeyPairGenerator _rsaKpg
public final KeyPairGenerator _dsaKpg
Constructor Detail |
---|
public KeyStoreManager(File root, String certificateRevocationList)
Method Detail |
---|
protected void createKeystore()
public void addCertAndPrivateKey(String hostname, X509Certificate cert, PrivateKey privKey) throws KeyStoreException, CertificateException, NoSuchAlgorithmException
KeyStoreException
CertificateException
NoSuchAlgorithmException
public void persist() throws KeyStoreException, NoSuchAlgorithmException, CertificateException
KeyStoreException
NoSuchAlgorithmException
CertificateException
public X509Certificate getCertificateByAlias(String alias) throws KeyStoreException
KeyStoreException
ThumbprintUtil
public X509Certificate getCertificateByHostname(String hostname) throws KeyStoreException, InvalidKeyException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, UnrecoverableKeyException
KeyStoreException
UnrecoverableKeyException
NoSuchProviderException
NoSuchAlgorithmException
CertificateException
SignatureException
CertificateNotYetValidException
CertificateExpiredException
InvalidKeyException
CertificateParsingException
ThumbprintUtil
public X509Certificate getSigningCert() throws KeyStoreException
KeyStoreException
public PrivateKey getSigningPrivateKey() throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException
KeyStoreException
NoSuchAlgorithmException
UnrecoverableKeyException
public X509Certificate getMappedCertificateForHostname(String hostname) throws InvalidKeyException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, KeyStoreException, UnrecoverableKeyException
CertificateParsingException
InvalidKeyException
CertificateExpiredException
CertificateNotYetValidException
SignatureException
CertificateException
NoSuchAlgorithmException
NoSuchProviderException
KeyStoreException
UnrecoverableKeyException
public KeyPair getRSAKeyPair()
public KeyStore getKeyStore()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |