Package org.opensaml.security.config

# Class BasicSecurityConfiguration

java.lang.Object
org.opensaml.security.config.BasicSecurityConfiguration

All Implemented Interfaces:
  `Component`, `IdentifiableComponent`, `IdentifiedComponent`, `SecurityConfiguration`

Direct Known Subclasses:
  `BasicXMLSecurityConfiguration`

public class BasicSecurityConfiguration extends Object implements SecurityConfiguration, IdentifiableComponent
Basic implementation of `SecurityConfiguration` interface.

Since:
  5.0.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private ClientTLSValidationConfiguration`
`clientTLSConfig`
Configuration used when validating client TLS X509Credentials.
`private final Duration`
`clockSkew`
Acceptable clock skew.
`private HttpClientSecurityConfiguration`
`httpClientConfig`
Configuration used when executing HttpClient requests.
`private String`
`id`
Identifier.
`private final IdentifierGenerationStrategy`
`idGenerator`
Generator used to generate various secure IDs (e.g., message identifiers).

## Constructor Summary

Constructors
Constructor
Description
`BasicSecurityConfiguration()`
Constructor.
`BasicSecurityConfiguration(Duration skew, IdentifierGenerationStrategy generator)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`ClientTLSValidationConfiguration`
`getClientTLSValidationConfiguration()`
Get the configuration used when validating client TLS X509Credentials.
`Duration`
`getClockSkew()`
Get the acceptable clock skew.
`HttpClientSecurityConfiguration`
`getHttpClientSecurityConfiguration()`
Get the configuration used when executing HttpClient requests.
`String`
`getId()`
`IdentifierGenerationStrategy`
`getIdGenerator()`
Get the generator used to generate secure identifiers.
`BasicSecurityConfiguration`
`setClientTLSValidationConfiguration(ClientTLSValidationConfiguration config)`
Set the configuration used when validating client TLS X509Credentials.
`BasicSecurityConfiguration`
`setHttpClientSecurityConfiguration(HttpClientSecurityConfiguration config)`
Set the configuration used when executing HttpClient requests.
`void`
`setId(String componentId)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### id

@Nullable private String id
Identifier.

### clockSkew

@Nonnull private final Duration clockSkew
Acceptable clock skew.

### idGenerator

@Nonnull private final IdentifierGenerationStrategy idGenerator
Generator used to generate various secure IDs (e.g., message identifiers).

### clientTLSConfig

@Nullable private ClientTLSValidationConfiguration clientTLSConfig
Configuration used when validating client TLS X509Credentials.

### httpClientConfig

@Nullable private HttpClientSecurityConfiguration httpClientConfig
Configuration used when executing HttpClient requests.

## Constructor Details

### BasicSecurityConfiguration

public BasicSecurityConfiguration()
Constructor. Initializes the clock skew to 5 minutes and the identifier generator to `IdentifierGenerationStrategy.ProviderType.SECURE`.

### BasicSecurityConfiguration

public BasicSecurityConfiguration(@Nonnull Duration skew, @Nonnull IdentifierGenerationStrategy generator)
Constructor.

Parameters:
  `skew` - the clock skew, must be greater than 0
  `generator` - the identifier generator, must not be null

## Method Details

### getId

@Nullable public String getId()

Specified by:
  `getId` in interface `IdentifiedComponent`

### setId

public void setId(@Nonnull String componentId)

Specified by:
  `setId` in interface `IdentifiableComponent`

### getClockSkew

@Nonnull public Duration getClockSkew()
Get the acceptable clock skew.

Specified by:
  `getClockSkew` in interface `SecurityConfiguration`
Returns:
  acceptable clock skew

### getIdGenerator

@Nonnull public IdentifierGenerationStrategy getIdGenerator()
Get the generator used to generate secure identifiers.

Specified by:
  `getIdGenerator` in interface `SecurityConfiguration`
Returns:
  generator used to generate secure identifiers

### getClientTLSValidationConfiguration

@Nullable public ClientTLSValidationConfiguration getClientTLSValidationConfiguration()
Get the configuration used when validating client TLS X509Credentials.

Specified by:
  `getClientTLSValidationConfiguration` in interface `SecurityConfiguration`
Returns:
  configuration used when validating client TLS X509Credentials, or null

### setClientTLSValidationConfiguration

@Nonnull public BasicSecurityConfiguration setClientTLSValidationConfiguration(@Nullable ClientTLSValidationConfiguration config)
Set the configuration used when validating client TLS X509Credentials.

Parameters:
  `config` - configuration used when validating client TLS X509Credentials, or null
Returns:
  this object

### getHttpClientSecurityConfiguration

@Nullable public HttpClientSecurityConfiguration getHttpClientSecurityConfiguration()
Get the configuration used when executing HttpClient requests.

Specified by:
  `getHttpClientSecurityConfiguration` in interface `SecurityConfiguration`
Returns:
  configuration used when executing HttpClient requests, or null

### setHttpClientSecurityConfiguration

@Nonnull public BasicSecurityConfiguration setHttpClientSecurityConfiguration(@Nullable HttpClientSecurityConfiguration config)
Set the configuration used when executing HttpClient requests.

Parameters:
  `config` - configuration used when executing HttpClient requests, or null
Returns:
  this object