|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Management interface for dealing with a specific Keystore
| Method Summary | |
boolean |
generateKeyPair(String alias,
char[] storePassword,
char[] keyPassword,
String keyAlgorithm,
int keySize,
String signatureAlgorithm,
int validity,
String commonName,
String orgUnit,
String organization,
String locality,
String state,
String country)
Generates a new private key and certificate pair in this keystore. |
Certificate |
getCertificate(String alias,
char[] storePassword)
Gets a particular certificate from the keystore. |
KeyManager[] |
getKeyManager(String algorithm,
String alias)
Gets a KeyManager for a key in this Keystore. |
String |
getKeystoreName()
Returns the name of the keystore as known to the keystore manager. |
TrustManager[] |
getTrustManager(String algorithm)
Gets a TrustManager for this keystore. |
String[] |
getUnlockedKeys()
Gets the aliases for all the private keys that are currently unlocked. |
boolean |
importTrustCertificate(Certificate cert,
String alias,
char[] storePassword)
Adds a certificate to this keystore as a trusted certificate. |
boolean |
isKeyLocked(String alias)
Checks whether the specified private key is locked, which is to say, available for other components to use to generate socket factories. |
boolean |
isKeystoreLocked()
Checks whether this keystore is unlocked, which is to say, available for other components to use to generate socket factories. |
boolean |
isTrustStore()
Checks whether this keystore can be used as a trust store (e.g. |
String[] |
listPrivateKeys(char[] storePassword)
Gets the aliases of all private key entries in the keystore |
String[] |
listTrustCertificates(char[] storePassword)
Gets the aliases of all trusted certificate entries in the keystore. |
void |
lockKeystore()
Clears any saved password, meaning this keystore cannot be used by other server components. |
void |
lockPrivateKey(String alias)
Clears any saved password for the specified private key, meaning this key cannot be used for a socket factory by other server components. |
boolean |
unlockKeystore(char[] password)
Saves a password to access the keystore as a whole. |
boolean |
unlockPrivateKey(String alias,
char[] password)
Saves a password to access a private key. |
| Method Detail |
public String getKeystoreName()
public boolean unlockKeystore(char[] password)
public void lockKeystore()
public boolean isKeystoreLocked()
public String[] listPrivateKeys(char[] storePassword)
storePassword - Used to open the keystore.
public boolean unlockPrivateKey(String alias,
char[] password)
throws KeystoreIsLocked
password - The password to save.
KeystoreIsLocked
public String[] getUnlockedKeys()
throws KeystoreIsLocked
KeystoreIsLocked
public boolean isTrustStore()
throws KeystoreIsLocked
KeystoreIsLockedpublic void lockPrivateKey(String alias)
public boolean isKeyLocked(String alias)
public String[] listTrustCertificates(char[] storePassword)
storePassword - Used to open the keystore.
public Certificate getCertificate(String alias,
char[] storePassword)
alias - The certificate to look atstorePassword - The password to use to access the keystore
public boolean importTrustCertificate(Certificate cert,
String alias,
char[] storePassword)
cert - The certificate to addalias - The alias to list the certificate understorePassword - The password for the keystore
public boolean generateKeyPair(String alias,
char[] storePassword,
char[] keyPassword,
String keyAlgorithm,
int keySize,
String signatureAlgorithm,
int validity,
String commonName,
String orgUnit,
String organization,
String locality,
String state,
String country)
alias - The alias to store the new key pair understorePassword - The password used to access the keystorekeyPassword - The password to use to protect the new keykeyAlgorithm - The algorithm used for the key (e.g. RSA)keySize - The number of bits in the key (e.g. 1024)signatureAlgorithm - The algorithm used to sign the key (e.g. MD5withRSA)validity - The number of days the certificate should be valid forcommonName - The CN portion of the identity on the certificateorgUnit - The OU portion of the identity on the certificateorganization - The O portion of the identity on the certificatelocality - The L portion of the identity on the certificatestate - The ST portion of the identity on the certificatecountry - The C portion of the identity on the certificate
public KeyManager[] getKeyManager(String algorithm,
String alias)
throws NoSuchAlgorithmException,
UnrecoverableKeyException,
KeyStoreException,
KeystoreIsLocked
algorithm - The SSL algorithm to use for this key manageralias - The alias of the key to use in the keystore
NoSuchAlgorithmException
UnrecoverableKeyException
KeyStoreException
KeystoreIsLocked
public TrustManager[] getTrustManager(String algorithm)
throws KeyStoreException,
NoSuchAlgorithmException,
KeystoreIsLocked
algorithm - The SSL algorithm to use for this trust manager
KeyStoreException
NoSuchAlgorithmException
KeystoreIsLocked
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||