public class KeyStore extends Object
Modifier and Type | Method and Description |
---|---|
Certificate |
getCertificate(String alias)
Get the certificate for a given key alias from keyStore.
|
Certificate |
getDefaultCertificate()
Get the default certificate for the service.
|
PrivateKey |
getDefaultPrivateKey()
Get the default private key of the service.
|
PublicKey |
getDefaultPublicKey()
Get the default public key for the service.
|
static KeyStore |
getKeyStore()
Get the KeyStore.
|
PrivateKey |
getPrivateKey(String alias,
char[] keyPassword)
Get the private key for a given key alias.
|
PublicKey |
getPublicKey(String alias)
Get the public key for a given key alias from keyStore.
|
Certificate |
getTrustedCertificate(String alias)
Get the certificate for a given key alias from trustStore.
|
PublicKey |
getTrustedPublicKey(String alias)
Get the public key for a given key alias from trustStore.
|
public static KeyStore getKeyStore()
public PublicKey getTrustedPublicKey(String alias) throws KeyStoreException
alias
- the alias nameKeyStoreException
- if the truststore has not been initialized
(loaded), or this operation fails for some other reasonpublic Certificate getTrustedCertificate(String alias) throws KeyStoreException
alias
- the alias nameKeyStoreException
- if the truststore has not been initialized
(loaded), or this operation fails for some other reasonpublic PrivateKey getPrivateKey(String alias, char[] keyPassword) throws KeyStoreException
alias
- the alias namekeyPassword
- the password to protect the keyKeyStoreException
- if the keystore has not been initialized
(loaded), if the algorithm for recovering the entry cannot be found,
alias
or keyPassword
does not contain
the information needed to recover the key (e.g. wrong password)public PublicKey getPublicKey(String alias) throws KeyStoreException
alias
- the alias nameKeyStoreException
- if the keystore has not been initialized
(loaded), or this operation fails for some other reasonpublic Certificate getCertificate(String alias) throws KeyStoreException
alias
- the alias nameKeyStoreException
- if the keystore has not been initialized
(loaded), or this operation fails for some other reasonpublic PrivateKey getDefaultPrivateKey() throws KeyStoreException
KeyStoreException
- if the keystore has not been initialized
(loaded), if the algorithm for recovering the entry cannot be found,
Keystore configuration does not contain
the information needed to recover the key (e.g. wrong password)public PublicKey getDefaultPublicKey() throws KeyStoreException
KeyStoreException
- if the keystore has not been initialized
(loaded), or this operation fails for some other reasonpublic Certificate getDefaultCertificate() throws KeyStoreException
KeyStoreException
- if the keystore has not been initialized
(loaded), or this operation fails for some other reasonCopyright © 2018 WSO2. All rights reserved.