@ThreadSafe
public class SecurityContext
extends Object
This is a helper class for the initialization of an SSL context. It is not intended to be generic; it tends to the specific needs of RVPF services.
Modifier and Type | Field and Description |
---|---|
static String |
CERTIFIED_PROPERTY
Certified property.
|
static String |
CRYPT_PROPERTIES
Crypt properties.
|
static String |
IDENT_PROPERTY
Ident property.
|
static String |
KEY_PROPERTIES
Key properties.
|
static String |
KEYSTORE_PROPERTIES
Keystore properties.
|
static String |
PASSWORD_PROPERTY
Password property.
|
static String |
PATH_PROPERTY
Path property.
|
static String |
PROVIDER_PROPERTY
Provider property.
|
static String |
REALM_PROPERTIES
Realm properties.
|
static String |
SECURE_PROPERTY
Secure property.
|
static String |
SECURITY_PROPERTIES
Security properties.
|
static String |
TRUSTSTORE_PROPERTIES
Truststore properties.
|
static String |
TYPE_PROPERTY
Type property.
|
Constructor and Description |
---|
SecurityContext(Logger logger)
Constructs an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
checkForSecureOperation()
Checks if configured for secure operation.
|
SSLContext |
createSSLContext()
Creates an SSL context.
|
KeyedGroups |
getCryptProperties()
Gets the crypt properties.
|
KeyStoreConfig |
getKeyStoreConfig()
Gets the KeyStore config.
|
Logger |
getLogger()
Gets the logger instance.
|
KeyedGroups |
getRealmProperties()
Gets the realm properties.
|
TrustStoreConfig |
getTrustStoreConfig()
Gets the TrustStore config.
|
boolean |
isCertified()
Gets the certified indicator.
|
boolean |
isSecure()
Gets the secure indicator.
|
boolean |
isServer()
Asks if this is a server context.
|
void |
setCertified(boolean certified)
Sets the certified indicator.
|
void |
setCryptProperties(KeyedGroups cryptProperties)
Sets the crypt properties.
|
void |
setRealmProperties(KeyedGroups realmProperties)
Sets the realm properties.
|
void |
setSecure(boolean secure)
Sets the secure indicator.
|
boolean |
setUp(KeyedGroups configProperties,
KeyedGroups securityProperties)
Sets up this.
|
protected void |
useDefaults()
Uses default values from system properties.
|
public static final String CERTIFIED_PROPERTY
public static final String CRYPT_PROPERTIES
public static final String IDENT_PROPERTY
public static final String KEYSTORE_PROPERTIES
public static final String KEY_PROPERTIES
public static final String PASSWORD_PROPERTY
public static final String PATH_PROPERTY
public static final String PROVIDER_PROPERTY
public static final String REALM_PROPERTIES
public static final String SECURE_PROPERTY
public static final String SECURITY_PROPERTIES
public static final String TRUSTSTORE_PROPERTIES
public static final String TYPE_PROPERTY
public SecurityContext(@Nonnull Logger logger)
logger
- The logger instance to use.public final void checkForSecureOperation() throws SSLException
SSLException
- When the check fails.@Nonnull @CheckReturnValue public final SSLContext createSSLContext() throws SSLException
This should be called only after all the appropriate attributes have been specified thru their setter.
This implementation will try to supply defaults for the missing values from the standard JSSE 'javax.net' properties.
SSLException
- When appropriate.@Nonnull @CheckReturnValue public KeyedGroups getCryptProperties()
@Nonnull @CheckReturnValue public KeyStoreConfig getKeyStoreConfig()
@Nonnull @CheckReturnValue public final Logger getLogger()
@Nonnull @CheckReturnValue public KeyedGroups getRealmProperties()
@Nonnull @CheckReturnValue public TrustStoreConfig getTrustStoreConfig()
@CheckReturnValue public final boolean isCertified()
@CheckReturnValue public final boolean isSecure()
@CheckReturnValue public boolean isServer()
public final void setCertified(boolean certified)
certified
- The certified indicator.public void setCryptProperties(@Nonnull KeyedGroups cryptProperties)
cryptProperties
- The crypt properties.public void setRealmProperties(@Nonnull KeyedGroups realmProperties)
realmProperties
- The realm properties.public final void setSecure(boolean secure)
secure
- The secure indicator.@CheckReturnValue public final boolean setUp(@Nonnull KeyedGroups configProperties, @Nonnull KeyedGroups securityProperties)
configProperties
- The configuration properties.securityProperties
- Security properties.protected void useDefaults() throws SSLException
SSLException
- When appropriate.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.