public interface KeyProvider
KeyProvider
is an interface
that is implemented to retrieve X509Certificates and Private Keys from
user data store.
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String alias)
Whether the key alias exists in the keystore.
|
Certificate |
getCertificate(PublicKey publicKey)
Returns certificate corresponding to the specified
PublicKey . |
String |
getCertificateAlias(Certificate cert)
Get the alias name of the first keystore entry whose certificate matches
the given certificate.
|
KeyPair |
getKeyPair(String certAlias)
|
KeyStore |
getKeyStore()
Returns the keystore instance.
|
PrivateKey |
getPrivateKey(String certAlias)
Returns
java.security.PrivateKey for the specified
certAlias . |
PrivateKey |
getPrivateKey(String certAlias,
String encryptedKeyPass)
Return the
PrivateKey for the specified certAlias and encrypted private key password. |
PublicKey |
getPublicKey(String keyAlias)
Returns
java.security.PublicKey for the specified
keyAlias |
SecretKey |
getSecretKey(String certAlias)
Retrieves the secret key for the given certificate alias.
|
X509Certificate |
getX509Certificate(String certAlias)
Return
java.security.cert.X509Certificate for the specified
certAlias . |
void |
setKey(String storepass,
String keypass)
Set the key to access key store database.
|
void setKey(String storepass, String keypass)
storepass
- password for the key storekeypass
- password for the certificateX509Certificate getX509Certificate(String certAlias)
java.security.cert.X509Certificate
for the specified
certAlias
.certAlias
- Certificate alias nameX509Certificate
which matches the
certAlias
, return null if the certificate could not
be found.PublicKey getPublicKey(String keyAlias)
java.security.PublicKey
for the specified
keyAlias
keyAlias
- Key alias namePublicKey
which matches the keyAlias
,
return null if the PublicKey
could not be found.PrivateKey getPrivateKey(String certAlias)
java.security.PrivateKey
for the specified
certAlias
.certAlias
- Certificate alias namePrivateKey
which matches the certAlias
,
return null if the private key could not be found.SecretKey getSecretKey(String certAlias)
certAlias
- the certificate alieasPrivateKey getPrivateKey(String certAlias, String encryptedKeyPass)
PrivateKey
for the specified certAlias and encrypted private key password.certAlias
- Certificate alias nameencryptedKeyPass
- The encrypted keypass to use when getting the private certificateString getCertificateAlias(Certificate cert)
cert
- CertificateCertificate getCertificate(PublicKey publicKey)
PublicKey
.publicKey
- Certificate public keyPublicKey
, return
null if the Certificate could not be found.KeyPair getKeyPair(String certAlias)
certAlias
- Certificate alias nameKeyStore getKeyStore()
boolean containsKey(String alias)
alias
- the key aliasCopyright © 2010-2018, ForgeRock All Rights Reserved.