Package org.apache.synapse.util.xpath
Class KeyStoreManager
- java.lang.Object
-
- org.apache.synapse.util.xpath.KeyStoreManager
-
public class KeyStoreManager extends Object
-
-
Constructor Summary
Constructors Constructor Description KeyStoreManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Certificate
getCertificateFromStore(KeyStore keyStore, String keyAlias)
Returns the Certificate of the given aliasstatic KeyStore
getKeyStore(String keyStoreFilePath, String keyStorePassword, String keyStoreType)
Returns the keystore of the given file pathstatic PrivateKey
getPrivateKeyFromKeyStore(KeyStore keyStore, String keyPassword, String keyAlias)
Returns the private key of the given alias
-
-
-
Method Detail
-
getKeyStore
public static KeyStore getKeyStore(String keyStoreFilePath, String keyStorePassword, String keyStoreType) throws KeyStoreException
Returns the keystore of the given file path- Parameters:
keyStoreFilePath
- the keystore file pathkeyStorePassword
- the keystore passwordkeyStoreType
- the keystore type- Returns:
- KeyStore
- Throws:
KeyStoreException
- On error while creating keystore
-
getCertificateFromStore
public static Certificate getCertificateFromStore(KeyStore keyStore, String keyAlias) throws KeyStoreException
Returns the Certificate of the given alias- Parameters:
keyStore
- the keystorekeyAlias
- the alias- Returns:
- Certificate
- Throws:
KeyStoreException
- On error while get the certificate
-
getPrivateKeyFromKeyStore
public static PrivateKey getPrivateKeyFromKeyStore(KeyStore keyStore, String keyPassword, String keyAlias) throws UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException
Returns the private key of the given alias- Parameters:
keyStore
- the keystorekeyPassword
- the keystore passwordkeyAlias
- the alias- Returns:
- PrivateKey
- Throws:
UnrecoverableKeyException
NoSuchAlgorithmException
KeyStoreException
-
-