Module jpms_dss_validation
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
ConstructorsModifierConstructorDescriptionprotectedValidationPolicyLoaderWithCryptoSuite(ValidationPolicyLoader validationPolicyLoader, eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite) Constructor to create aValidationPolicyFactoryusing a custom validation policy -
Method Summary
Modifier and TypeMethodDescriptionandAcceptableDigestAlgorithmsLevel(eu.europa.esig.dss.enumerations.Level level) Sets the execution level for acceptable digest algorithms check of the last provided cryptographic suiteandAcceptableEncryptionAlgorithmsLevel(eu.europa.esig.dss.enumerations.Level level) Sets the execution level for acceptable encryption algorithms check of the last provided cryptographic suiteandAcceptableEncryptionAlgorithmsMiniKeySizeLevel(eu.europa.esig.dss.enumerations.Level level) Sets the execution level for acceptable minimum key sizes of encryption algorithms check of the last provided cryptographic suiteandAlgorithmsExpirationDateLevel(eu.europa.esig.dss.enumerations.Level level) Sets the execution level for the expiration of the cryptographic algorithms check of the last provided cryptographic suiteandAlgorithmsExpirationTimeAfterPolicyUpdateLevel(eu.europa.esig.dss.enumerations.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 suiteandLevel(eu.europa.esig.dss.enumerations.Level level) Sets the global execution level for the last provided cryptographic suiteeu.europa.esig.dss.model.policy.ValidationPolicycreate()Builds aValidationPolicywithCryptographicSuite(eu.europa.esig.dss.model.DSSDocument cryptographicSuite) Sets a global cryptographic suiteDSSDocument.withCryptographicSuite(eu.europa.esig.dss.model.policy.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(eu.europa.esig.dss.model.DSSDocument cryptographicSuite, eu.europa.esig.dss.enumerations.Context context) Sets a cryptographic suiteDSSDocumentfor the given Context.withCryptographicSuiteForContext(eu.europa.esig.dss.model.DSSDocument cryptographicSuite, eu.europa.esig.dss.enumerations.Context context, eu.europa.esig.dss.enumerations.SubContext subContext) Sets a cryptographic suiteDSSDocumentfor the given Context and SubContext.withCryptographicSuiteForContext(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.Context context) Sets a cryptographic suite for the given Context.withCryptographicSuiteForContext(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.Context context, eu.europa.esig.dss.enumerations.SubContext subContext) Sets a cryptographic suite for the given Context and SubContext.withCryptographicSuiteForContext(File cryptographicSuiteFile, eu.europa.esig.dss.enumerations.Context context) Sets a cryptographic suiteFilefor the given Context.withCryptographicSuiteForContext(File cryptographicSuiteFile, eu.europa.esig.dss.enumerations.Context context, eu.europa.esig.dss.enumerations.SubContext subContext) Sets a cryptographic suiteFilefor the given Context and SubContext.withCryptographicSuiteForContext(InputStream cryptographicSuiteIS, eu.europa.esig.dss.enumerations.Context context) Sets a cryptographic suiteInputStreamfor the given Context.withCryptographicSuiteForContext(InputStream cryptographicSuiteIS, eu.europa.esig.dss.enumerations.Context context, eu.europa.esig.dss.enumerations.SubContext subContext) Sets a cryptographic suiteInputStreamfor the given Context and SubContext.withCryptographicSuiteForContext(String cryptographicSuiteFilePath, eu.europa.esig.dss.enumerations.Context context) Sets a cryptographic suite file for the given Context.withCryptographicSuiteForContext(String cryptographicSuiteFilePath, eu.europa.esig.dss.enumerations.Context context, eu.europa.esig.dss.enumerations.SubContext subContext) Sets a cryptographic suite file for the given Context and SubContext.Sets a default cryptographic suite for the given Context and SubContext.withDefaultCryptographicSuiteForContext(eu.europa.esig.dss.enumerations.Context context) Sets a default cryptographic suite for the given Context and SubContext.withDefaultCryptographicSuiteForContext(eu.europa.esig.dss.enumerations.Context context, eu.europa.esig.dss.enumerations.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, eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite) Constructor to create aValidationPolicyFactoryusing a custom validation policy- Parameters:
validationPolicyLoader-ValidationPolicyLoadercryptographicSuite-CryptographicSuite
-
-
Method Details
-
withDefaultCryptographicSuite
Description copied from class:ValidationPolicyLoaderSets 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:
withDefaultCryptographicSuitein classValidationPolicyLoader- Returns:
ValidationPolicyLoader
-
withCryptographicSuite
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuite(eu.europa.esig.dss.model.DSSDocument cryptographicSuite) Description copied from class:ValidationPolicyLoaderSets a global cryptographic suiteDSSDocument. The suite will overwrite all cryptographic constraints defined in the originalValidationPolicyfile. It is also will be used when a cryptographic suite is not provided for a specific scope. The method#withCryptographicSuiteForContextcan be used to specify constraints for a specific scope.- Overrides:
withCryptographicSuitein classValidationPolicyLoader- Parameters:
cryptographicSuite-DSSDocument- Returns:
ValidationPolicyLoader
-
withCryptographicSuite
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuite(InputStream cryptographicSuiteIS) Description copied from class:ValidationPolicyLoaderSets a global cryptographic suiteInputStream. The suite will overwrite all cryptographic constraints defined in the originalValidationPolicyfile. It is also will be used when a cryptographic suite is not provided for a specific scope. The method#withCryptographicSuiteForContextcan be used to specify constraints for a specific scope.- Overrides:
withCryptographicSuitein classValidationPolicyLoader- Parameters:
cryptographicSuiteIS-InputStream- Returns:
ValidationPolicyLoader
-
withCryptographicSuite
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuite(File cryptographicSuiteFile) Description copied from class:ValidationPolicyLoaderSets a global cryptographic suiteFile. The suite will overwrite all cryptographic constraints defined in the originalValidationPolicyfile. It is also will be used when a cryptographic suite is not provided for a specific scope. The method#withCryptographicSuiteForContextcan be used to specify constraints for a specific scope.- Overrides:
withCryptographicSuitein classValidationPolicyLoader- Parameters:
cryptographicSuiteFile-File- Returns:
ValidationPolicyLoader
-
withCryptographicSuite
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuite(String cryptographicSuiteFilePath) Description copied from class:ValidationPolicyLoaderSets a global cryptographic suite file. The suite will overwrite all cryptographic constraints defined in the originalValidationPolicyfile. It is also will be used when a cryptographic suite is not provided for a specific scope. The method#withCryptographicSuiteForContextcan be used to specify constraints for a specific scope.- Overrides:
withCryptographicSuitein classValidationPolicyLoader- Parameters:
cryptographicSuiteFilePath-Stringpath to the cryptographic suite file, located against the classpath (getClass().getResourceAsStream), and NOT the filesystem- Returns:
ValidationPolicyLoader
-
withCryptographicSuite
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuite(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite) Description copied from class:ValidationPolicyLoaderSets a global cryptographic suite. The suite will overwrite all cryptographic constraints defined in the originalValidationPolicyfile. It is also will be used when a cryptographic suite is not provided for a specific scope. The method#withCryptographicSuiteForContextcan be used to specify constraints for a specific scope.- Overrides:
withCryptographicSuitein classValidationPolicyLoader- Parameters:
cryptographicSuite-CryptographicSuite- Returns:
ValidationPolicyLoader
-
withDefaultCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withDefaultCryptographicSuiteForContext(eu.europa.esig.dss.enumerations.Context context) Description copied from class:ValidationPolicyLoaderSets 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:
withDefaultCryptographicSuiteForContextin classValidationPolicyLoader- Parameters:
context-Context- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(eu.europa.esig.dss.model.DSSDocument cryptographicSuite, eu.europa.esig.dss.enumerations.Context context) Description copied from class:ValidationPolicyLoaderSets a cryptographic suiteDSSDocumentfor 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:
withCryptographicSuiteForContextin classValidationPolicyLoader- Parameters:
cryptographicSuite-DSSDocumentcontext-Context- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(InputStream cryptographicSuiteIS, eu.europa.esig.dss.enumerations.Context context) Description copied from class:ValidationPolicyLoaderSets a cryptographic suiteInputStreamfor 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:
withCryptographicSuiteForContextin classValidationPolicyLoader- Parameters:
cryptographicSuiteIS-InputStreamcontext-Context- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(File cryptographicSuiteFile, eu.europa.esig.dss.enumerations.Context context) Description copied from class:ValidationPolicyLoaderSets a cryptographic suiteFilefor 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:
withCryptographicSuiteForContextin classValidationPolicyLoader- Parameters:
cryptographicSuiteFile-Filecontext-Context- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(String cryptographicSuiteFilePath, eu.europa.esig.dss.enumerations.Context context) Description copied from class:ValidationPolicyLoaderSets 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:
withCryptographicSuiteForContextin classValidationPolicyLoader- Parameters:
cryptographicSuiteFilePath-Stringpath to the cryptographic suite file, located against the classpath (getClass().getResourceAsStream), and NOT the filesystemcontext-Context- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.Context context) Description copied from class:ValidationPolicyLoaderSets 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:
withCryptographicSuiteForContextin classValidationPolicyLoader- Parameters:
cryptographicSuite-CryptographicSuitecontext-Context- Returns:
ValidationPolicyLoader
-
withDefaultCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withDefaultCryptographicSuiteForContext(eu.europa.esig.dss.enumerations.Context context, eu.europa.esig.dss.enumerations.SubContext subContext) Description copied from class:ValidationPolicyLoaderSets 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:
withDefaultCryptographicSuiteForContextin classValidationPolicyLoader- Parameters:
context-ContextsubContext-SubContext- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(eu.europa.esig.dss.model.DSSDocument cryptographicSuite, eu.europa.esig.dss.enumerations.Context context, eu.europa.esig.dss.enumerations.SubContext subContext) Description copied from class:ValidationPolicyLoaderSets a cryptographic suiteDSSDocumentfor 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:
withCryptographicSuiteForContextin classValidationPolicyLoader- Parameters:
cryptographicSuite-DSSDocumentcontext-ContextsubContext-SubContext- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(InputStream cryptographicSuiteIS, eu.europa.esig.dss.enumerations.Context context, eu.europa.esig.dss.enumerations.SubContext subContext) Description copied from class:ValidationPolicyLoaderSets a cryptographic suiteInputStreamfor 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:
withCryptographicSuiteForContextin classValidationPolicyLoader- Parameters:
cryptographicSuiteIS-InputStreamcontext-ContextsubContext-SubContext- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(File cryptographicSuiteFile, eu.europa.esig.dss.enumerations.Context context, eu.europa.esig.dss.enumerations.SubContext subContext) Description copied from class:ValidationPolicyLoaderSets a cryptographic suiteFilefor 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:
withCryptographicSuiteForContextin classValidationPolicyLoader- Parameters:
cryptographicSuiteFile-Filecontext-ContextsubContext-SubContext- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(String cryptographicSuiteFilePath, eu.europa.esig.dss.enumerations.Context context, eu.europa.esig.dss.enumerations.SubContext subContext) Description copied from class:ValidationPolicyLoaderSets 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:
withCryptographicSuiteForContextin classValidationPolicyLoader- Parameters:
cryptographicSuiteFilePath-Stringpath to the cryptographic suite file, located against the classpath (getClass().getResourceAsStream), and NOT the filesystemcontext-ContextsubContext-SubContext- Returns:
ValidationPolicyLoader
-
withCryptographicSuiteForContext
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite withCryptographicSuiteForContext(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.Context context, eu.europa.esig.dss.enumerations.SubContext subContext) Description copied from class:ValidationPolicyLoaderSets 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:
withCryptographicSuiteForContextin classValidationPolicyLoader- Parameters:
cryptographicSuite-CryptographicSuitecontext-ContextsubContext-SubContext- Returns:
ValidationPolicyLoader
-
create
public eu.europa.esig.dss.model.policy.ValidationPolicy create()Description copied from class:ValidationPolicyLoaderBuilds aValidationPolicy- Overrides:
createin classValidationPolicyLoader- Returns:
ValidationPolicy
-
andLevel
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite andLevel(eu.europa.esig.dss.enumerations.Level level) Sets the global execution level for the last provided cryptographic suite- Parameters:
level-Level- Returns:
- this
-
andAcceptableDigestAlgorithmsLevel
public ValidationPolicyLoader.ValidationPolicyLoaderWithCryptoSuite andAcceptableDigestAlgorithmsLevel(eu.europa.esig.dss.enumerations.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(eu.europa.esig.dss.enumerations.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(eu.europa.esig.dss.enumerations.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(eu.europa.esig.dss.enumerations.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(eu.europa.esig.dss.enumerations.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
-