public class SecurityDomain extends Object implements Cloneable
SecurityDomainManager| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_HTTPS_CIPHERSUITES
Default CIPHER SUITE which will be used unless overriddent:
"TLS_RSA_WITH_NULL_SHA,TLS_RSA_WITH_AES_128_CBC_SHA"
|
static String |
DEFAULT_HTTPS_PROTOCOLS
Default https.protocols value unless specified otherwise: "TLSv1"
|
static String |
DEFAULT_SECURITY_DOMAIN
Name of the default security domain
|
static String |
HTTPS_CIPHERSUITES |
static String |
HTTPS_PROTOCOLS |
static String |
JAVAX_NET_DEBUG |
static String |
JAVAX_NET_SSL_KEYSTORE |
static String |
JAVAX_NET_SSL_KEYSTORE_PASSWORD |
static String |
JAVAX_NET_SSL_TRUSTSTORE |
static String |
JAVAX_NET_SSL_TRUSTSTORE_PASSWORD |
protected boolean |
keystoreInitialized |
static String |
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_128_CBC_SHA
|
static String |
TLS_RSA_WITH_NULL_SHA
TLS_RSA_WITH_NULL_SHA
|
protected boolean |
truststoreInitialized |
| Constructor and Description |
|---|
SecurityDomain(String name,
Properties properties)
Creates a security domain that uses the default key alias from the keystore
|
SecurityDomain(String name,
String preferredAlias,
Properties properties)
Properites file requires the following properties to be set
Key Store: javax.net.ssl.keyStore=XXX javax.net.ssl.keyStorePassword=XXX (if not present, defaults to "") optional: Trust Store: javax.net.ssl.trustStore=XXX If this is not present, then no truststore is initialized javax.net.ssl.trustStorePassword=XXX - if not present, defaults to "" http.ciphersuites=XXX list of suites to use. |
| Modifier and Type | Method and Description |
|---|---|
SecurityDomain |
clone() |
SecurityDomain |
clone(String newName) |
boolean |
doDomainSpoofCheck() |
String[] |
getCipherSuites() |
KeyManagerFactory |
getKeyManagerFactory()
Deprecated.
|
KeyManager[] |
getKeyManagers() |
KeyStore |
getKeyStore() |
String |
getName()
Returns the name of the security domain
|
String |
getPreferredKeyAlias() |
TrustManagerFactory |
getTrustManagerFactory()
Deprecated.
|
TrustManager[] |
getTrustManagers() |
KeyStore |
getTrustStore() |
protected void |
initKeyStore(InputStream keystoreInputStream,
char[] keystorePassword) |
protected void |
initStores()
Initialize the key and trust stores
|
protected void |
initTrustStore(InputStream truststoreInputStream,
char[] truststorePassword) |
void |
restoreSystemEnvironment()
Restores the System environmnet to what it was before
Also see setDomainEnvironment() |
void |
setDomainEnvironment()
Sets the System environment to support the Security Domain's settings.
|
void |
setDomainSpoofCheck(boolean check) |
void |
setPreferredKeyAlias(String preferredKeyAlias,
boolean validate) |
void |
setProperties(Properties properties) |
public static final String JAVAX_NET_DEBUG
public static final String JAVAX_NET_SSL_TRUSTSTORE
public static final String JAVAX_NET_SSL_KEYSTORE
public static final String JAVAX_NET_SSL_TRUSTSTORE_PASSWORD
public static final String JAVAX_NET_SSL_KEYSTORE_PASSWORD
public static final String HTTPS_CIPHERSUITES
public static final String HTTPS_PROTOCOLS
public static String TLS_RSA_WITH_AES_128_CBC_SHA
public static String TLS_RSA_WITH_NULL_SHA
public static String DEFAULT_HTTPS_CIPHERSUITES
public static String DEFAULT_HTTPS_PROTOCOLS
public static String DEFAULT_SECURITY_DOMAIN
protected boolean keystoreInitialized
protected boolean truststoreInitialized
public SecurityDomain(String name, Properties properties) throws SecurityDomainException
name - properties - SecurityDomainExceptionpublic SecurityDomain(String name, String preferredAlias, Properties properties) throws SecurityDomainException
name - name of the namepreferredAlias - Keystore alias to use when doing secure handshakeproperties - SecurityDomainExceptionpublic void setProperties(Properties properties) throws SecurityDomainException
properties - SecurityDomainExceptionpublic void setDomainEnvironment()
restoreSystemEnvironment()public void restoreSystemEnvironment()
setDomainEnvironment()protected void initTrustStore(InputStream truststoreInputStream, char[] truststorePassword) throws SecurityDomainException, NoSuchAlgorithmException, CertificateException, IOException
truststoreInputStream - truststorePassword - NoSuchAlgorithmExceptionCertificateExceptionIOExceptionSecurityDomainExceptionprotected void initKeyStore(InputStream keystoreInputStream, char[] keystorePassword) throws SecurityDomainException, NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException, IOException
keystoreInputStream - keystorePassword - NoSuchAlgorithmExceptionCertificateExceptionUnrecoverableKeyExceptionIOExceptionSecurityDomainExceptionprotected void initStores()
throws SecurityDomainException
SecurityDomainExceptionpublic KeyStore getKeyStore()
public KeyStore getTrustStore()
public KeyManager[] getKeyManagers()
public TrustManager[] getTrustManagers()
public KeyManagerFactory getKeyManagerFactory()
public TrustManagerFactory getTrustManagerFactory()
public String getName()
public String[] getCipherSuites()
public String getPreferredKeyAlias()
public void setPreferredKeyAlias(String preferredKeyAlias, boolean validate) throws SecurityDomainException
SecurityDomainExceptionpublic boolean doDomainSpoofCheck()
public void setDomainSpoofCheck(boolean check)
public SecurityDomain clone()
public SecurityDomain clone(String newName)
Copyright © 2016 Open eHealth Foundation. All rights reserved.