1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Added support for key and trust stores when making SSL/TLS connections

that require the client authenticate itself.  This supports PKCS#11 devices.


git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@9538 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Jay Kline 2007-11-30 19:40:31 +00:00 committed by jay
parent dbac260051
commit d3ee0e2f3e
2 changed files with 109 additions and 25 deletions

View file

@ -46,7 +46,7 @@ public class ConnectionConfiguration implements Cloneable {
private String truststorePassword;
private String keystorePath;
private String keystoreType;
private String keystorePassword;
private String pkcsConfig;
private boolean verifyChainEnabled = false;
private boolean verifyRootCAEnabled = false;
private boolean selfSignedCertificateEnabled = false;
@ -133,7 +133,7 @@ public class ConnectionConfiguration implements Cloneable {
truststorePassword = "changeit";
keystorePath = System.getProperty("javax.net.ssl.keyStore");
keystoreType = "jks";
keystorePassword = "changeit";
pkcsConfig = "pkcs11.config";
}
/**
@ -286,24 +286,25 @@ public class ConnectionConfiguration implements Cloneable {
this.keystoreType = keystoreType;
}
/**
* Returns the password to use to access the keystore file. It is assumed that all
* certificates share the same password in the keystore.
* Returns the PKCS11 configuration file location, needed when the
* Keystore type is PKCS11.
*
* @return the password to use to access the keystore file.
* @return the path to the PKCS11 configuration file
*/
public String getKeystorePassword() {
return keystorePassword;
public String getPKCSConfig() {
return pkcsConfig;
}
/**
* Sets the password to use to access the keystore file. It is assumed that all
* certificates share the same password in the trust store.
* Sets the PKCS11 configuration file location, needed when the
* Keystore type is PKCS11
*
* @param keystorePassword the password to use to access the keystore file.
* @param pkcsConfig the path to the PKCS11 configuration file
*/
public void setKeystorePassword(String keystorePassword) {
this.keystorePassword = keystorePassword;
public void setPKCSConfig(String pkcsConfig) {
this.pkcsConfig = pkcsConfig;
}
/**