Class ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite
java.lang.Object
eu.europa.esig.dss.validation.policy.ValidationPolicyLoader
eu.europa.esig.dss.validation.policy.ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite
- Enclosing class:
ValidationPolicyLoader
public static class ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite
extends ValidationPolicyLoader
This class provides a user-friendly configuration of the execution levels for the last set cryptographic suite.
For generic methods inherited from
ValidationPolicyLoader
, the execution is propagated to
the original instance of the loader.-
Nested Class Summary
Nested classes/interfaces inherited from class eu.europa.esig.dss.validation.policy.ValidationPolicyLoader
ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ValidationPolicyLoaderWithCryptoSuite
(ValidationPolicyLoader validationPolicyLoader, CryptographicSuite cryptographicSuite) Constructor to create aValidationPolicyFactory
using a custom validation policy -
Method Summary
Modifier and TypeMethodDescriptionSets the execution level for acceptable digest algorithms check of the last provided cryptographic suiteSets the execution level for acceptable encryption algorithms check of the last provided cryptographic suiteSets the execution level for acceptable minimum key sizes of encryption algorithms check of the last provided cryptographic suiteSets the execution level for the expiration of the cryptographic algorithms check of the last provided cryptographic suiteSets the execution level for the expiration after the cryptographic suite update date of the cryptographic algorithms check of the last provided cryptographic suiteSets the global execution level for the last provided cryptographic suitecreate()
Builds aValidationPolicy
withCryptographicSuite
(DSSDocument cryptographicSuite) Sets a global cryptographic suiteDSSDocument
.withCryptographicSuite
(CryptographicSuite cryptographicSuite) Sets a global cryptographic suite.withCryptographicSuite
(File cryptographicSuiteFile) Sets a global cryptographic suiteFile
.withCryptographicSuite
(InputStream cryptographicSuiteIS) Sets a global cryptographic suiteInputStream
.withCryptographicSuite
(String cryptographicSuiteFilePath) Sets a global cryptographic suite file.withCryptographicSuiteForContext
(DSSDocument cryptographicSuite, Context context) Sets a cryptographic suiteDSSDocument
for the given Context.withCryptographicSuiteForContext
(DSSDocument cryptographicSuite, Context context, SubContext subContext) Sets a cryptographic suiteDSSDocument
for the given Context and SubContext.withCryptographicSuiteForContext
(CryptographicSuite cryptographicSuite, Context context) Sets a cryptographic suite for the given Context.withCryptographicSuiteForContext
(CryptographicSuite cryptographicSuite, Context context, SubContext subContext) Sets a cryptographic suite for the given Context and SubContext.withCryptographicSuiteForContext
(File cryptographicSuiteFile, Context context) Sets a cryptographic suiteFile
for the given Context.withCryptographicSuiteForContext
(File cryptographicSuiteFile, Context context, SubContext subContext) Sets a cryptographic suiteFile
for the given Context and SubContext.withCryptographicSuiteForContext
(InputStream cryptographicSuiteIS, Context context) Sets a cryptographic suiteInputStream
for the given Context.withCryptographicSuiteForContext
(InputStream cryptographicSuiteIS, Context context, SubContext subContext) Sets a cryptographic suiteInputStream
for the given Context and SubContext.withCryptographicSuiteForContext
(String cryptographicSuiteFilePath, Context context) Sets a cryptographic suite file for the given Context.withCryptographicSuiteForContext
(String cryptographicSuiteFilePath, Context context, SubContext subContext) Sets a cryptographic suite file for the given Context and SubContext.Sets a default cryptographic suite for the given Context and SubContext.Sets a default cryptographic suite for the given Context and SubContext.withDefaultCryptographicSuiteForContext
(Context context, SubContext subContext) Sets a default cryptographic suite for the given Context and SubContext.Methods inherited from class eu.europa.esig.dss.validation.policy.ValidationPolicyLoader
fromDefaultValidationPolicy, fromValidationPolicy, fromValidationPolicy, fromValidationPolicy, fromValidationPolicy, fromValidationPolicy
-
Constructor Details
-
ValidationPolicyLoaderWithCryptoSuite
protected ValidationPolicyLoaderWithCryptoSuite(ValidationPolicyLoader validationPolicyLoader, CryptographicSuite cryptographicSuite) Constructor to create aValidationPolicyFactory
using a custom validation policy- Parameters:
validationPolicyLoader
-ValidationPolicyLoader
cryptographicSuite
-CryptographicSuite
-
-
Method Details
-
withDefaultCryptographicSuite
Description copied from class:ValidationPolicyLoader
Sets a default cryptographic suite for the given Context and SubContext. This method will load the first available cryptographic suite. DSS provides two modules with implementations, namely 'dss-policy-crypto-xml' and 'dss-policy-crypto-json'. The supported contexts are: SIGNATURE, COUNTER_SIGNATURE, TIMESTAMP, EVIDENCE_RECORD, REVOCATION. The supported subContext are: SIGNING_CERT and CA_CERTIFICATE. The cryptographic suite will be used only for the specific scope.- Overrides:
withDefaultCryptographicSuite
in classValidationPolicyLoader
- Returns:
ValidationPolicyLoader
-
withCryptographicSuite
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuite(DSSDocument cryptographicSuite) Description copied from class:ValidationPolicyLoader
Sets a global cryptographic suiteDSSDocument
. The suite will overwrite all cryptographic constraints defined in the originalValidationPolicy
file. It is also will be used when a cryptographic suite is not provided for a specific scope. The method#withCryptographicSuiteForContext
can be used to specify constraints for a specific scope.- Overrides:
withCryptographicSuite
in classValidationPolicyLoader
- Parameters:
cryptographicSuite
-DSSDocument
- Returns:
ValidationPolicyLoader
-
withCryptographicSuite
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuite(InputStream cryptographicSuiteIS) Description copied from class:ValidationPolicyLoader
Sets a global cryptographic suiteInputStream
. The suite will overwrite all cryptographic constraints defined in the originalValidationPolicy
file. It is also will be used when a cryptographic suite is not provided for a specific scope. The method#withCryptographicSuiteForContext
can be used to specify constraints for a specific scope.- Overrides:
withCryptographicSuite
in classValidationPolicyLoader
- Parameters:
cryptographicSuiteIS
-InputStream
- Returns:
ValidationPolicyLoader
-
withCryptographicSuite
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuite(File cryptographicSuiteFile) Description copied from class:ValidationPolicyLoader
Sets a global cryptographic suiteFile
. The suite will overwrite all cryptographic constraints defined in the originalValidationPolicy
file. It is also will be used when a cryptographic suite is not provided for a specific scope. The method#withCryptographicSuiteForContext
can be used to specify constraints for a specific scope.- Overrides:
withCryptographicSuite
in classValidationPolicyLoader
- Parameters:
cryptographicSuiteFile
-File
- Returns:
ValidationPolicyLoader
-
withCryptographicSuite
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuite(String cryptographicSuiteFilePath) Description copied from class:ValidationPolicyLoader
Sets a global cryptographic suite file. The suite will overwrite all cryptographic constraints defined in the originalValidationPolicy
file. It is also will be used when a cryptographic suite is not provided for a specific scope. The method#withCryptographicSuiteForContext
can be used to specify constraints for a specific scope.- Overrides:
withCryptographicSuite
in classValidationPolicyLoader
- Parameters:
cryptographicSuiteFilePath
-String
path to the cryptographic suite file, located against the classpath (getClass().getResourceAsStream), and NOT the filesystem- Returns:
ValidationPolicyLoader
-
withCryptographicSuite
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuite(CryptographicSuite cryptographicSuite) Description copied from class:ValidationPolicyLoader
Sets a global cryptographic suite. The suite will overwrite all cryptographic constraints defined in the originalValidationPolicy
file. It is also will be used when a cryptographic suite is not provided for a specific scope. The method#withCryptographicSuiteForContext
can be used to specify constraints for a specific scope.- Overrides:
withCryptographicSuite
in classValidationPolicyLoader
- Parameters:
cryptographicSuite
-CryptographicSuite
- Returns:
ValidationPolicyLoader
-
withDefaultCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withDefaultCryptographicSuiteForContext(Context context) Description copied from class:ValidationPolicyLoader
Sets a default cryptographic suite for the given Context and SubContext. This method will load the first available cryptographic suite. DSS provides two modules with implementations, namely 'dss-policy-crypto-xml' and 'dss-policy-crypto-json'. The supported contexts are: SIGNATURE, COUNTER_SIGNATURE, TIMESTAMP, EVIDENCE_RECORD, REVOCATION. The supported subContext are: SIGNING_CERT and CA_CERTIFICATE. The cryptographic suite will be used only for the specific scope.- Overrides:
withDefaultCryptographicSuiteForContext
in classValidationPolicyLoader
- Parameters:
context
-Context
- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(DSSDocument cryptographicSuite, Context context) Description copied from class:ValidationPolicyLoader
Sets a cryptographic suiteDSSDocument
for the given Context. The supported contexts are: SIGNATURE, COUNTER_SIGNATURE, TIMESTAMP, EVIDENCE_RECORD, REVOCATION. The cryptographic suite will be used only for the specific scope.- Overrides:
withCryptographicSuiteForContext
in classValidationPolicyLoader
- Parameters:
cryptographicSuite
-DSSDocument
context
-Context
- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(InputStream cryptographicSuiteIS, Context context) Description copied from class:ValidationPolicyLoader
Sets a cryptographic suiteInputStream
for the given Context. The supported contexts are: SIGNATURE, COUNTER_SIGNATURE, TIMESTAMP, EVIDENCE_RECORD, REVOCATION. The cryptographic suite will be used only for the specific scope.- Overrides:
withCryptographicSuiteForContext
in classValidationPolicyLoader
- Parameters:
cryptographicSuiteIS
-InputStream
context
-Context
- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(File cryptographicSuiteFile, Context context) Description copied from class:ValidationPolicyLoader
Sets a cryptographic suiteFile
for the given Context. The supported contexts are: SIGNATURE, COUNTER_SIGNATURE, TIMESTAMP, EVIDENCE_RECORD, REVOCATION. The cryptographic suite will be used only for the specific scope.- Overrides:
withCryptographicSuiteForContext
in classValidationPolicyLoader
- Parameters:
cryptographicSuiteFile
-File
context
-Context
- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(String cryptographicSuiteFilePath, Context context) Description copied from class:ValidationPolicyLoader
Sets a cryptographic suite file for the given Context. The supported contexts are: SIGNATURE, COUNTER_SIGNATURE, TIMESTAMP, EVIDENCE_RECORD, REVOCATION. The cryptographic suite will be used only for the specific scope.- Overrides:
withCryptographicSuiteForContext
in classValidationPolicyLoader
- Parameters:
cryptographicSuiteFilePath
-String
path to the cryptographic suite file, located against the classpath (getClass().getResourceAsStream), and NOT the filesystemcontext
-Context
- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(CryptographicSuite cryptographicSuite, Context context) Description copied from class:ValidationPolicyLoader
Sets a cryptographic suite for the given Context. The supported contexts are: SIGNATURE, COUNTER_SIGNATURE, TIMESTAMP, EVIDENCE_RECORD, REVOCATION. The cryptographic suite will be used only for the specific scope.- Overrides:
withCryptographicSuiteForContext
in classValidationPolicyLoader
- Parameters:
cryptographicSuite
-CryptographicSuite
context
-Context
- Returns:
ValidationPolicyLoader
-
withDefaultCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withDefaultCryptographicSuiteForContext(Context context, SubContext subContext) Description copied from class:ValidationPolicyLoader
Sets a default cryptographic suite for the given Context and SubContext. This method will load the first available cryptographic suite. DSS provides two modules with implementations, namely 'dss-policy-crypto-xml' and 'dss-policy-crypto-json'. The supported contexts are: SIGNATURE, COUNTER_SIGNATURE, TIMESTAMP, EVIDENCE_RECORD, REVOCATION. The supported subContext are: SIGNING_CERT and CA_CERTIFICATE. The cryptographic suite will be used only for the specific scope.- Overrides:
withDefaultCryptographicSuiteForContext
in classValidationPolicyLoader
- Parameters:
context
-Context
subContext
-SubContext
- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(DSSDocument cryptographicSuite, Context context, SubContext subContext) Description copied from class:ValidationPolicyLoader
Sets a cryptographic suiteDSSDocument
for the given Context and SubContext. The supported contexts are: SIGNATURE, COUNTER_SIGNATURE, TIMESTAMP, EVIDENCE_RECORD, REVOCATION. The supported subContext are: SIGNING_CERT and CA_CERTIFICATE. The cryptographic suite will be used only for the specific scope.- Overrides:
withCryptographicSuiteForContext
in classValidationPolicyLoader
- Parameters:
cryptographicSuite
-DSSDocument
context
-Context
subContext
-SubContext
- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(InputStream cryptographicSuiteIS, Context context, SubContext subContext) Description copied from class:ValidationPolicyLoader
Sets a cryptographic suiteInputStream
for the given Context and SubContext. The supported contexts are: SIGNATURE, COUNTER_SIGNATURE, TIMESTAMP, EVIDENCE_RECORD, REVOCATION. The supported subContext are: SIGNING_CERT and CA_CERTIFICATE. The cryptographic suite will be used only for the specific scope.- Overrides:
withCryptographicSuiteForContext
in classValidationPolicyLoader
- Parameters:
cryptographicSuiteIS
-InputStream
context
-Context
subContext
-SubContext
- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(File cryptographicSuiteFile, Context context, SubContext subContext) Description copied from class:ValidationPolicyLoader
Sets a cryptographic suiteFile
for the given Context and SubContext. The supported contexts are: SIGNATURE, COUNTER_SIGNATURE, TIMESTAMP, EVIDENCE_RECORD, REVOCATION. The supported subContext are: SIGNING_CERT and CA_CERTIFICATE. The cryptographic suite will be used only for the specific scope.- Overrides:
withCryptographicSuiteForContext
in classValidationPolicyLoader
- Parameters:
cryptographicSuiteFile
-File
context
-Context
subContext
-SubContext
- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(String cryptographicSuiteFilePath, Context context, SubContext subContext) Description copied from class:ValidationPolicyLoader
Sets a cryptographic suite file for the given Context and SubContext. The supported contexts are: SIGNATURE, COUNTER_SIGNATURE, TIMESTAMP, EVIDENCE_RECORD, REVOCATION. The supported subContext are: SIGNING_CERT and CA_CERTIFICATE. The cryptographic suite will be used only for the specific scope.- Overrides:
withCryptographicSuiteForContext
in classValidationPolicyLoader
- Parameters:
cryptographicSuiteFilePath
-String
path to the cryptographic suite file, located against the classpath (getClass().getResourceAsStream), and NOT the filesystemcontext
-Context
subContext
-SubContext
- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(CryptographicSuite cryptographicSuite, Context context, SubContext subContext) Description copied from class:ValidationPolicyLoader
Sets a cryptographic suite for the given Context and SubContext. The supported contexts are: SIGNATURE, COUNTER_SIGNATURE, TIMESTAMP, EVIDENCE_RECORD, REVOCATION. The supported subContext are: SIGNING_CERT and CA_CERTIFICATE. The cryptographic suite will be used only for the specific scope.- Overrides:
withCryptographicSuiteForContext
in classValidationPolicyLoader
- Parameters:
cryptographicSuite
-CryptographicSuite
context
-Context
subContext
-SubContext
- Returns:
ValidationPolicyLoader
-
create
Description copied from class:ValidationPolicyLoader
Builds aValidationPolicy
- Overrides:
create
in classValidationPolicyLoader
- Returns:
ValidationPolicy
-
andLevel
Sets the global execution level for the last provided cryptographic suite- Parameters:
level
-Level
- Returns:
- this
-
andAcceptableDigestAlgorithmsLevel
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite andAcceptableDigestAlgorithmsLevel(Level level) Sets the execution level for acceptable digest algorithms check of the last provided cryptographic suite- Parameters:
level
-Level
- Returns:
- this
-
andAcceptableEncryptionAlgorithmsLevel
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite andAcceptableEncryptionAlgorithmsLevel(Level level) Sets the execution level for acceptable encryption algorithms check of the last provided cryptographic suite- Parameters:
level
-Level
- Returns:
- this
-
andAcceptableEncryptionAlgorithmsMiniKeySizeLevel
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite andAcceptableEncryptionAlgorithmsMiniKeySizeLevel(Level level) Sets the execution level for acceptable minimum key sizes of encryption algorithms check of the last provided cryptographic suite- Parameters:
level
-Level
- Returns:
- this
-
andAlgorithmsExpirationDateLevel
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite andAlgorithmsExpirationDateLevel(Level level) Sets the execution level for the expiration of the cryptographic algorithms check of the last provided cryptographic suite- Parameters:
level
-Level
- Returns:
- this
-
andAlgorithmsExpirationTimeAfterPolicyUpdateLevel
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite andAlgorithmsExpirationTimeAfterPolicyUpdateLevel(Level level) Sets the execution level for the expiration after the cryptographic suite update date of the cryptographic algorithms check of the last provided cryptographic suite- Parameters:
level
-Level
- Returns:
- this
-