
public class WaarpSecureKeyStore extends Object
| Constructor and Description |
|---|
WaarpSecureKeyStore(String _keyStorePasswd,
String _keyPassword)
Initialize empty KeyStore.
|
WaarpSecureKeyStore(String keyStoreFilename,
String _keyStorePasswd,
String _keyPassword)
Initialize the SecureKeyStore with no TrustStore from file
|
WaarpSecureKeyStore(String keyStoreFilename,
String _keyStorePasswd,
String _keyPassword,
String trustStoreFilename,
String _trustStorePasswd,
boolean needClientAuthent)
Initialize the SecureKeyStore and TrustStore from files
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
deleteKeyFromKeyStore(String alias)
Delete a Key from the KeyStore based on its alias
|
boolean |
deleteKeyFromTrustStore(String alias)
Delete a Key from the TrustStore based on its alias
|
char[] |
getCertificatePassword() |
KeyManagerFactory |
getKeyManagerFactory() |
char[] |
getKeyStorePassword() |
char[] |
getKeyTrustStorePassword() |
WaarpSecureTrustManagerFactory |
getSecureTrustManagerFactory() |
boolean |
initEmptyTrustStore()
Initialize an empty TrustStore
|
void |
initKeyStore(String _keyStoreFilename,
String _keyStorePasswd,
String _keyPassword)
Initialize the SecureKeyStore with no TrustStore from file
|
void |
initTrustStore(String _trustStoreFilename,
String _trustStorePasswd,
boolean needClientAuthent)
Initialize the TrustStore from a filename and its password
|
static Certificate |
loadX509Certificate(String filename)
Load a certificate from a filename
|
boolean |
saveKeyStore(String filename)
Save a KeyStore to a file
|
boolean |
saveTrustStore(String filename)
Save the TrustStore to a file
|
boolean |
setKeytoKeyStore(String alias,
Key key,
Certificate[] chain)
Add a Key and its certificates into the KeyStore based on its alias
|
boolean |
setKeytoTrustStore(String alias,
Certificate cert)
Add a Certificate into the TrustStore based on its alias
|
public WaarpSecureKeyStore(String _keyStorePasswd, String _keyPassword) throws CryptoException
_keyStorePasswd - _keyPassword - CryptoExceptionpublic WaarpSecureKeyStore(String keyStoreFilename, String _keyStorePasswd, String _keyPassword) throws CryptoException
keyStoreFilename - _keyStorePasswd - _keyPassword - CryptoExceptionpublic WaarpSecureKeyStore(String keyStoreFilename, String _keyStorePasswd, String _keyPassword, String trustStoreFilename, String _trustStorePasswd, boolean needClientAuthent) throws CryptoException
keyStoreFilename - _keyStorePasswd - _keyPassword - trustStoreFilename - if Null, no TrustKeyStore will be created_trustStorePasswd - needClientAuthent - True if the TrustStore is also used for Client AuthenticationCryptoExceptionpublic void initKeyStore(String _keyStoreFilename, String _keyStorePasswd, String _keyPassword) throws CryptoException
_keyStoreFilename - _keyStorePasswd - _keyPassword - CryptoExceptionpublic boolean deleteKeyFromKeyStore(String alias)
alias - public boolean setKeytoKeyStore(String alias, Key key, Certificate[] chain)
alias - key - chain - public boolean saveKeyStore(String filename)
filename - public void initTrustStore(String _trustStoreFilename, String _trustStorePasswd, boolean needClientAuthent) throws CryptoException
_trustStoreFilename - _trustStorePasswd - needClientAuthent - True if the TrustStore is also to authenticate clientsCryptoExceptionpublic boolean initEmptyTrustStore()
public boolean deleteKeyFromTrustStore(String alias)
alias - public boolean setKeytoTrustStore(String alias, Certificate cert)
alias - cert - public boolean saveTrustStore(String filename)
filename - public static Certificate loadX509Certificate(String filename) throws CertificateException, FileNotFoundException
filename - CertificateExceptionFileNotFoundExceptionpublic char[] getCertificatePassword()
public char[] getKeyStorePassword()
public char[] getKeyTrustStorePassword()
public WaarpSecureTrustManagerFactory getSecureTrustManagerFactory()
public KeyManagerFactory getKeyManagerFactory()
Copyright © 2009–2019 Waarp. All rights reserved.