|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.net.util.KeyManagerUtils
public final class KeyManagerUtils
General KeyManager utilities
How to use with a client certificate:
KeyManager km = KeyManagerUtils.createClientKeyManager("JKS", "/path/to/privatekeystore.jks","storepassword", "privatekeyalias", "keypassword"); FTPSClient cl = new FTPSClient(); cl.setKeyManager(km); cl.connect(...);If using the default store type and the key password is the same as the store password, these parameters can be omitted.
KeyManager km = KeyManagerUtils.createClientKeyManager( "/path/to/privatekeystore.jks","storepassword"); FTPSClient cl = new FTPSClient(); cl.setKeyManager(km); cl.connect(...);
Method Summary | |
---|---|
static KeyManager |
createClientKeyManager(File storePath,
String storePass)
Create a client key manager which returns a particular key. |
static KeyManager |
createClientKeyManager(File storePath,
String storePass,
String keyAlias)
Create a client key manager which returns a particular key. |
static KeyManager |
createClientKeyManager(KeyStore ks,
String keyAlias,
String keyPass)
Create a client key manager which returns a particular key. |
static KeyManager |
createClientKeyManager(String storeType,
File storePath,
String storePass,
String keyAlias,
String keyPass)
Create a client key manager which returns a particular key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static KeyManager createClientKeyManager(KeyStore ks, String keyAlias, String keyPass) throws GeneralSecurityException
ks
- the keystore to usekeyAlias
- the alias of the key to use, may be null
in which case the first key entry alias is usedkeyPass
- the password of the key to use
GeneralSecurityException
public static KeyManager createClientKeyManager(String storeType, File storePath, String storePass, String keyAlias, String keyPass) throws IOException, GeneralSecurityException
storeType
- the type of the keyStore, e.g. "JKS"storePath
- the path to the keyStorestorePass
- the keyStore passwordkeyAlias
- the alias of the key to use, may be null
in which case the first key entry alias is usedkeyPass
- the password of the key to use
IOException
GeneralSecurityException
public static KeyManager createClientKeyManager(File storePath, String storePass, String keyAlias) throws IOException, GeneralSecurityException
storePath
- the path to the keyStorestorePass
- the keyStore passwordkeyAlias
- the alias of the key to use, may be null
in which case the first key entry alias is used
IOException
GeneralSecurityException
public static KeyManager createClientKeyManager(File storePath, String storePass) throws IOException, GeneralSecurityException
storePath
- the path to the keyStorestorePass
- the keyStore password
IOException
GeneralSecurityException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |