public class SecurityContext extends Object
The keystore and truststore files may be generated using the JAVA
keytool
command. The root CA and reply certificates can be
imported into keystore file or can create different truststore file.
Example key and certificate management:
keytool -genkey -alias server -keyalg RSA -keysize 2048 \ -keystore controller.jks \ -dname "CN=controller,OU=HPN, O=HP, L=Roseville, ST=CA, C=US"
keytool -certreq -alias server -file controller.csr \ -keystore controller.jks
keytool -importcert -trustcacerts -keystore controller.jks \ -file root.pem -alias theCARoot -keypass skyline -storepass skyline
keytool -importcert -trustcacerts -keystore controller.jks \ -file controller.pem -alias server -keypass skyline -storepass skyline
Constructor and Description |
---|
SecurityContext()
Constructs a null security context; that is all four parameters are
empty strings.
|
SecurityContext(String keyStoreName,
String keyStorePass,
String trustStoreName,
String trustStorePass)
Constructs a security context with the specified arguments.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
String |
keyStoreName()
Returns the pathname of the keystore.
|
String |
keyStorePass()
Returns the keystore password.
|
String |
toString() |
String |
trustStoreName()
Returns the pathname of the truststore.
|
String |
trustStorePass()
Returns the truststore password.
|
public SecurityContext(String keyStoreName, String keyStorePass, String trustStoreName, String trustStorePass)
null
arguments are quietly replaced with an empty string.keyStoreName
- the pathname of the keystorekeyStorePass
- the keystore passwordtrustStoreName
- the pathname of the truststoretrustStorePass
- the truststore passwordpublic SecurityContext()
public String keyStoreName()
public String keyStorePass()
public String trustStoreName()
public String trustStorePass()
Copyright © 2015. All Rights Reserved.