public class KeyStoreManager
extends java.lang.Object
Constructor and Description |
---|
KeyStoreManager() |
Modifier and Type | Method and Description |
---|---|
static java.security.cert.Certificate |
getCertificateFromStore(java.security.KeyStore keyStore,
java.lang.String keyAlias)
Returns the Certificate of the given alias
|
static java.security.KeyStore |
getKeyStore(java.lang.String keyStoreFilePath,
java.lang.String keyStorePassword,
java.lang.String keyStoreType)
Returns the keystore of the given file path
|
static java.security.PrivateKey |
getPrivateKeyFromKeyStore(java.security.KeyStore keyStore,
java.lang.String keyPassword,
java.lang.String keyAlias)
Returns the private key of the given alias
|
public static java.security.KeyStore getKeyStore(java.lang.String keyStoreFilePath, java.lang.String keyStorePassword, java.lang.String keyStoreType) throws java.security.KeyStoreException
keyStoreFilePath
- the keystore file pathkeyStorePassword
- the keystore passwordkeyStoreType
- the keystore typejava.security.KeyStoreException
- On error while creating keystorepublic static java.security.cert.Certificate getCertificateFromStore(java.security.KeyStore keyStore, java.lang.String keyAlias) throws java.security.KeyStoreException
keyStore
- the keystorekeyAlias
- the aliasjava.security.KeyStoreException
- On error while get the certificatepublic static java.security.PrivateKey getPrivateKeyFromKeyStore(java.security.KeyStore keyStore, java.lang.String keyPassword, java.lang.String keyAlias) throws java.security.UnrecoverableKeyException, java.security.NoSuchAlgorithmException, java.security.KeyStoreException
keyStore
- the keystorekeyPassword
- the keystore passwordkeyAlias
- the aliasUnrecoverableKeyException,NoSuchAlgorithmException,KeyStoreException
- On error while get private keyjava.security.UnrecoverableKeyException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
Copyright © 2005-2022 Apache Software Foundation. All Rights Reserved.