Class KeyStoreWrapper
java.lang.Object
org.apache.synapse.securevault.keystore.KeyStoreWrapper
- Direct Known Subclasses:
IdentityKeyStoreWrapper,TrustKeyStoreWrapper
Wraps the keyStore and provide abstraction need for ciphering.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected KeyReturns the key based on default alias or passwordprotected KeyReturns the key based on provided alias and key passwordprotected KeyStoreReturns KeyStore Informationprotected KeygetPrivateKey(String alias) Returns the key based on default key passwordReturns the public key based on initialization datagetPublicKey(String alias) Returns the public key for the given aliasprotected KeyReturns the key based on certificate of the owner to who given alias belongReturns the secret key based on initialization datagetSecretKey(String alias, String keyPassword) Returns the secret keyprotected voidinit(KeyStoreInformation information, String keyPassword) Initialize the KeyStore wrapper based on provided KeyStoreInformation and passwords
-
Field Details
-
log
protected org.apache.commons.logging.Log log
-
-
Constructor Details
-
KeyStoreWrapper
protected KeyStoreWrapper()
-
-
Method Details
-
init
Initialize the KeyStore wrapper based on provided KeyStoreInformation and passwords- Parameters:
information- The object that has encapsulated all information for a keyStore excepts passwordskeyPassword- Specifies the password of the key within the keyStore
-
getKey
Returns the key based on provided alias and key password- Parameters:
alias- The alias of the certificate in the specified keyStorekeyPassword- Password for key within the KeyStrore- Returns:
- Key if there is a one , otherwise null
-
getPublicKeyFromCertificate
Returns the key based on certificate of the owner to who given alias belong- Parameters:
alias- The alias of the certificate in the specified keyStore- Returns:
- Key , if there is a one , otherwise null
-
getDefaultPrivateKey
Returns the key based on default alias or password- Returns:
- Key , if there is a one , otherwise null
-
getPrivateKey
Returns the key based on default key password- Parameters:
alias- The alias- Returns:
- Key , if there is a one , otherwise null
-
getPublicKey
Returns the public key for the given alias- Parameters:
alias- The alias of the certificate in the specified keyStore- Returns:
- PublicKey if there is a one , otherwise null
-
getPublicKey
Returns the public key based on initialization data- Returns:
- PublicKey if there is a one , otherwise null
-
getKeyStore
Returns KeyStore Information- Returns:
- KeyStore Instance
-
getSecretKey
Returns the secret key- Parameters:
alias- The alias of the certificate in the specified keyStorekeyPassword- Password to access secret key- Returns:
- SecretKey if there is a one , otherwise null
-
getSecretKey
Returns the secret key based on initialization data- Returns:
- SecretKey if there is a one , otherwise null
-