Class AbstractSignedDocumentProcessor<T,X extends AdesObject>
java.lang.Object
se.idsec.signservice.integration.document.impl.AbstractSignedDocumentProcessor<T,X>
- Type Parameters:
T
- the type of signature documentX
- AdES type
- All Implemented Interfaces:
DocumentProcessor<T>
,SignedDocumentProcessor<T,
X>
public abstract class AbstractSignedDocumentProcessor<T,X extends AdesObject>
extends Object
implements SignedDocumentProcessor<T,X>
Abstract base class for
SignedDocumentProcessor
implementations.- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Ensures that theprocessingConfiguration
property is assigned.protected se.swedenconnect.security.algorithms.AlgorithmRegistry
Gets the algorithm registry.Gets the processing configuration that this processor is configured with.protected void
performAdditionalAdesValidation
(X adesObject, X509Certificate signingCertificate, se.swedenconnect.schemas.csig.dssext_1_1.SignTaskData signTaskData, SignRequestWrapper signRequest, SignResponseWrapper signResponse, se.idsec.signservice.integration.SignResponseProcessingParameters parameters) ThevalidateAdesObject(AdesObject, X509Certificate, SignTaskData, SignRequestWrapper, SignResponseWrapper, SignResponseProcessingParameters)
method validates that the signer certificate digest of the AdES object is valid.void
setAlgorithmRegistry
(se.swedenconnect.security.algorithms.AlgorithmRegistry algorithmRegistry) Assigns the algorithm registry to use.void
setProcessingConfiguration
(SignResponseProcessingConfig processingConfiguration) Assigns the processing configuration.final void
validateAdesObject
(X adesObject, X509Certificate signingCertificate, se.swedenconnect.schemas.csig.dssext_1_1.SignTaskData signTaskData, SignRequestWrapper signRequest, SignResponseWrapper signResponse, se.idsec.signservice.integration.SignResponseProcessingParameters parameters) Given a AdES object from the signature the method validates that it is valid.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface se.idsec.signservice.integration.document.DocumentProcessor
getDocumentDecoder, getDocumentEncoder
Methods inherited from interface se.idsec.signservice.integration.document.SignedDocumentProcessor
buildSignedDocument, supports, validateSignedDocument
-
Constructor Details
-
AbstractSignedDocumentProcessor
public AbstractSignedDocumentProcessor()
-
-
Method Details
-
validateAdesObject
public final void validateAdesObject(@Nonnull X adesObject, @Nonnull X509Certificate signingCertificate, @Nonnull se.swedenconnect.schemas.csig.dssext_1_1.SignTaskData signTaskData, @Nonnull SignRequestWrapper signRequest, @Nonnull SignResponseWrapper signResponse, se.idsec.signservice.integration.SignResponseProcessingParameters parameters) throws se.idsec.signservice.integration.core.error.SignServiceIntegrationException Given a AdES object from the signature the method validates that it is valid.- Specified by:
validateAdesObject
in interfaceSignedDocumentProcessor<T,
X extends AdesObject> - Parameters:
adesObject
- the AdES objectsigningCertificate
- the signing certificatesignTaskData
- the sign task datasignRequest
- the sign requestsignResponse
- the sign responseparameters
- processing parameters received from the caller- Throws:
se.idsec.signservice.integration.core.error.SignServiceIntegrationException
- for validation errors
-
performAdditionalAdesValidation
protected void performAdditionalAdesValidation(X adesObject, X509Certificate signingCertificate, se.swedenconnect.schemas.csig.dssext_1_1.SignTaskData signTaskData, SignRequestWrapper signRequest, SignResponseWrapper signResponse, se.idsec.signservice.integration.SignResponseProcessingParameters parameters) throws DocumentProcessingException ThevalidateAdesObject(AdesObject, X509Certificate, SignTaskData, SignRequestWrapper, SignResponseWrapper, SignResponseProcessingParameters)
method validates that the signer certificate digest of the AdES object is valid. Implementations wishing to check other aspects of the AdES object should implement this method. The default implemention does nothing.Validaton errors should use the error code "ades-validation-error", e.g.
throw new DocumentProcessingException(new ErrorCode.Code("ades-validation-error"), msg)
.- Parameters:
adesObject
- the AdES objectsigningCertificate
- the signing certificatesignTaskData
- the sign datasignRequest
- the sign requestsignResponse
- the sign responseparameters
- optional processing parameters- Throws:
DocumentProcessingException
- for validation errors
-
getProcessingConfiguration
Gets the processing configuration that this processor is configured with.- Specified by:
getProcessingConfiguration
in interfaceSignedDocumentProcessor<T,
X extends AdesObject> - Returns:
- the processing configuration
-
setProcessingConfiguration
Assigns the processing configuration.- Parameters:
processingConfiguration
- processing configuration
-
getAlgorithmRegistry
protected se.swedenconnect.security.algorithms.AlgorithmRegistry getAlgorithmRegistry()Gets the algorithm registry. If none has been configured, theAlgorithmRegistrySingleton
will be used.- Returns:
- the algorithm registry to use
-
setAlgorithmRegistry
public void setAlgorithmRegistry(se.swedenconnect.security.algorithms.AlgorithmRegistry algorithmRegistry) Assigns the algorithm registry to use.- Parameters:
algorithmRegistry
- the algorithm registry to use
-
afterPropertiesSet
Ensures that theprocessingConfiguration
property is assigned. By defaultSignResponseProcessingConfig.defaultSignResponseProcessingConfig()
is used.Note: If executing in a Spring Framework environment this method is automatically invoked after all properties have been assigned. Otherwise it should be explicitly invoked.
- Throws:
Exception
- for init errors
-