@InterfaceAudience.Public public class KeyStoreKeyProvider extends Object implements KeyProvider
scheme://path?option1=value1&option2=value2
scheme can be either "jks" or "jceks", specifying the file based providers shipped with every JRE. The latter is the certificate store for the SunJCE cryptography extension, or PKCS #12, and is capable of storing SecretKeys.
path is the location of the keystore in the filesystem namespace.
Options can be specified as query parameters.
If the store was created with a password, the password can be specified using the option 'password'.
For example:
jceks:///var/tmp/example.ks?password=foobar
It is assumed that all keys in the store are protected with the same password.
Alternatively, a properties file can be specified containing passwords for keys in the keystore.
jceks:///var/tmp/example.ks?passwordFile=/var/tmp/example.pw
Subclasses for supporting KeyStores that are not file based can extend the protected methods of this class to specify the appropriate LoadStoreParameters.
限定符和类型 | 字段和说明 |
---|---|
protected char[] |
password |
protected Properties |
passwordFile |
protected KeyStore |
store |
PASSWORD, PASSWORDFILE
构造器和说明 |
---|
KeyStoreKeyProvider() |
限定符和类型 | 方法和说明 |
---|---|
protected char[] |
getAliasPassword(String alias) |
Key |
getKey(String alias)
Retrieve the key for a given key aliase
|
Key[] |
getKeys(String[] aliases)
Retrieve keys for a given set of key aliases
|
void |
init(String params)
Initialize the key provider
|
protected void |
load(URI uri) |
protected void |
processParameter(String name,
String value) |
protected void |
processParameters(URI uri) |
protected KeyStore store
protected char[] password
protected Properties passwordFile
protected void processParameter(String name, String value) throws IOException
IOException
protected void processParameters(URI uri) throws IOException
IOException
protected void load(URI uri) throws IOException
IOException
public void init(String params)
KeyProvider
init
在接口中 KeyProvider
protected char[] getAliasPassword(String alias)
public Key getKey(String alias)
KeyProvider
getKey
在接口中 KeyProvider
public Key[] getKeys(String[] aliases)
KeyProvider
getKeys
在接口中 KeyProvider
aliases
- an array of aliasesCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.