|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface KeystoreInstance
Management interface for dealing with a specific Keystore
| Method Summary | |
|---|---|
void |
changeKeyPassword(String alias,
char[] storePassword,
char[] keyPassword,
char[] newKeyPassword)
Changes the password for a private key entry in the keystore. |
void |
changeKeystorePassword(char[] storePassword,
char[] newPassword)
Changes the keystore password. |
void |
deleteEntry(String alias,
char[] storePassword)
Deletes a key from this Keystore. |
String |
generateCSR(String alias,
char[] storePassword)
|
void |
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)
Gets a particular certificate from the keystore. |
Certificate |
getCertificate(String alias,
char[] storePassword)
Gets a particular certificate from the keystore. |
String |
getCertificateAlias(Certificate cert,
char[] storePassword)
Gets the alias corresponding to the given certificate. |
Certificate[] |
getCertificateChain(String alias,
char[] storePassword)
Gets a particular certificate chain from the keystore. |
KeyManager[] |
getKeyManager(String algorithm,
String alias,
char[] storePassword)
Gets a KeyManager for a key in this Keystore. |
String |
getKeystoreName()
Returns the name of the keystore as known to the keystore manager. |
String |
getKeystoreType()
Returns the type of the keystore. |
PrivateKey |
getPrivateKey(String alias,
char[] storePassword,
char[] keyPassword)
Gets the private key with the specified alias. |
TrustManager[] |
getTrustManager(String algorithm,
char[] storePassword)
Gets a TrustManager for this keystore. |
String[] |
getUnlockedKeys(char[] storePassword)
Gets the aliases for all the private keys that are currently unlocked. |
void |
importPKCS7Certificate(String alias,
String certbuf,
char[] storePassword)
|
void |
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(char[] storePassword)
Checks whether this keystore can be used as a trust store (e.g. has at least one trust certificate). |
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(char[] password)
Clears any saved password, meaning this keystore cannot be used by other server components. |
void |
lockPrivateKey(String alias,
char[] storePassword)
Clears any saved password for the specified private key, meaning this key cannot be used for a socket factory by other server components. |
void |
unlockKeystore(char[] password)
Saves a password to access the keystore as a whole. |
void |
unlockPrivateKey(String alias,
char[] storePassword,
char[] keyPassword)
Saves a password to access a private key. |
| Method Detail |
|---|
String getKeystoreName()
String getKeystoreType()
void unlockKeystore(char[] password)
throws KeystoreException
KeystoreException
void lockKeystore(char[] password)
throws KeystoreException
KeystoreExceptionboolean isKeystoreLocked()
String[] listPrivateKeys(char[] storePassword)
throws KeystoreException
storePassword - Used to open the keystore. If null, the
internal password will be used and may
KeystoreIsLocked - if a null password was provided and the keystore
is locked, or if a bad password was provided
KeystoreException
void unlockPrivateKey(String alias,
char[] storePassword,
char[] keyPassword)
throws KeystoreException
password - The password to save.
KeystoreException
String[] getUnlockedKeys(char[] storePassword)
throws KeystoreException
KeystoreException
boolean isTrustStore(char[] storePassword)
throws KeystoreException
KeystoreException
void lockPrivateKey(String alias,
char[] storePassword)
throws KeystoreException
storePassword - The password used to access the keystore. Must be non-null.
KeystoreIsLocked
KeystoreExceptionboolean isKeyLocked(String alias)
String[] listTrustCertificates(char[] storePassword)
throws KeystoreException
storePassword - Used to open the keystore or null to use the internal password.
KeystoreIsLocked - if the keystore coul not be unlocked
KeystoreException
Certificate getCertificate(String alias,
char[] storePassword)
throws KeystoreException
alias - The certificate to look atstorePassword - Used to open the keystore or null to use the internal password.
KeystoreException
Certificate[] getCertificateChain(String alias,
char[] storePassword)
throws KeystoreException
alias - The certificate chain to look atstorePassword - Used to open the keystore or null to use the internal password.
KeystoreIsLocked - if the keystore coul not be unlocked
KeystoreException
String getCertificateAlias(Certificate cert,
char[] storePassword)
throws KeystoreException
alias - The certificate used to retrieve the aliasstorePassword - Used to open the keystore or null to use the internal password.
KeystoreIsLocked - if the keystore coul not be unlocked
KeystoreException
void importTrustCertificate(Certificate cert,
String alias,
char[] storePassword)
throws KeystoreException
cert - The certificate to addalias - The alias to list the certificate understorePassword - Used to open the keystore. Must be non null
KeystoreException
void 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)
throws KeystoreException
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
KeystoreException
KeyManager[] getKeyManager(String algorithm,
String alias,
char[] storePassword)
throws KeystoreException
algorithm - The SSL algorithm to use for this key manageralias - The alias of the key to use in the keystorestorePassword - The password used to access the keystore
KeystoreException
TrustManager[] getTrustManager(String algorithm,
char[] storePassword)
throws KeystoreException
algorithm - The SSL algorithm to use for this trust managerstorePassword - The password used to access the keystore
KeystoreException
String generateCSR(String alias,
char[] storePassword)
throws KeystoreException
KeystoreException
void importPKCS7Certificate(String alias,
String certbuf,
char[] storePassword)
throws KeystoreException
KeystoreException
void deleteEntry(String alias,
char[] storePassword)
throws KeystoreException
alias - the alias to deletestorePassword - The password used to access the keystore
KeystoreException
PrivateKey getPrivateKey(String alias,
char[] storePassword,
char[] keyPassword)
throws KeystoreException
alias - The alias of the private key to be retrievedstorePassword - The password used to access the keystorekeyPassword - The password to use to protect the new key
KeystoreExceptionCertificate getCertificate(String alias)
alias - Alias of the certificate
void changeKeystorePassword(char[] storePassword,
char[] newPassword)
throws KeystoreException
storePassword - Current password for the keystorenewPassword - New password for the keystore
KeystoreException
void changeKeyPassword(String alias,
char[] storePassword,
char[] keyPassword,
char[] newKeyPassword)
throws KeystoreException
storePassword - Password for the keystorekeyPassword - Current password for the private keynewKeyPassword - New password for the private key
KeystoreException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||