|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxades4j.verification.XadesVerificationProfile
public final class XadesVerificationProfile
A profile for signature verification. This class is the entry point for verifying a signature. A profile is a configuration for the signature verification process.
The purpose of this class is to create a XadesVerifier that will actually
verify signatures using the configured components.
The minimum configuration is a CertificateValidationProvider
because the validation data (trust-achors, CRLs, etc) has to be properly selected. All the other components
have default implementations that are used if no other actions are taken. However,
all of them can be replaced through the corresponding methods, either by an instance
or a class. When a class is used it may have dependencies on other components,
which will be handled in order to create the XadesVerifier. The types may
also depend on external components, as long as that dependency is registered
with on of the addBinding methods. To that end, the constructors and/or
setters should use the Inject annotation from Guice.
Custom QualifyingPropertyVerifiers can also be configured. The principles
on their dependencies are the same. In addition, custom verifiers over the whole
signature can be configured. Finally, verifiers for specific XML elements may
be added. This can be usefull if one wants to handle an unsigned property that
is not known by the library, as the default unmarshaller will create GenericDOMData
instances for those properties if acceptUnknownProperties is set.
Repeated dependency bindings will not cause an immediate error. An exception
will be thrown when an instance of XadesVerifier is requested.
| Constructor Summary | |
|---|---|
XadesVerificationProfile(CertificateValidationProvider certificateValidationProvider)
|
|
XadesVerificationProfile(Class<? extends CertificateValidationProvider> certificateValidationProviderClass)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XadesVerificationProfile(CertificateValidationProvider certificateValidationProvider)
public XadesVerificationProfile(Class<? extends CertificateValidationProvider> certificateValidationProviderClass)
| Method Detail |
|---|
public <T> XadesVerificationProfile withBinding(Class<T> from,
Class<? extends T> to)
from is found, the to class is used. The to class
may in turn have its own dependencies.
The other withNNNNNN methods are convenient shortcuts for this one.
from - the dependencyto - the type that resolves the dependency
public <T> XadesVerificationProfile withBinding(Class<T> from,
T to)
from is found, the to instance is used.
The other withNNNNNN methods are convenient shortcuts for this one.
from - the dependencyto - the instance that resolves the dependency
public final XadesVerifier newVerifier()
throws XadesProfileResolutionException
XadesVerifier based on the current state of the profile.
If any changes are made after this call, the previously returned verifier will
not be afected. Other verifiers can be created, accumulating the profile changes.
XadesVerifier accordingly to this profile.
XadesProfileResolutionException - if the dependencies of the signer (direct and indirect) cannot be resolvedpublic XadesVerificationProfile withDigestEngineProvider(MessageDigestEngineProvider digestProvider)
public XadesVerificationProfile withDigestEngineProvider(Class<? extends MessageDigestEngineProvider> digestProviderClass)
public XadesVerificationProfile withPolicyDocumentProvider(SignaturePolicyDocumentProvider policyDocProvider)
public XadesVerificationProfile withPolicyDocumentProvider(Class<? extends SignaturePolicyDocumentProvider> policyDocProviderClass)
public XadesVerificationProfile withTimeStampTokenVerifier(TimeStampVerificationProvider tsTokenVerifProv)
public XadesVerificationProfile withTimeStampTokenVerifier(Class<? extends TimeStampVerificationProvider> tsTokenVerifProvClass)
public XadesVerificationProfile withPropertiesUnmarshaller(QualifyingPropertiesUnmarshaller propsUnmarshaller)
public XadesVerificationProfile withPropertiesUnmarshaller(Class<? extends QualifyingPropertiesUnmarshaller> propsUnmarshallerClass)
public XadesVerificationProfile acceptUnknownProperties(boolean accept)
QualifyingPropertiesUnmarshaller
which controls if a GenericDOMData should be used when an unknown
property is found.
The schema for signed signature and data object properties is closed; as such, this only affects the unsigned properties.
Note that it is also possible to implement a custom QualifyingPropertiesUnmarshallers.
The withElementVerifier
method can be used to register verifiers for unknown properties.
QualifyingPropertiesUnmarshallerpublic XadesVerificationProfile withGlobalDataObjsStructureVerifier(CustomPropertiesDataObjsStructureVerifier v)
public XadesVerificationProfile withCustomSignatureVerifier(CustomSignatureVerifier v)
public XadesVerificationProfile withElementVerifier(QName elemName,
Class<? extends QualifyingPropertyVerifier> vClass)
public <TData extends PropertyDataObject> XadesVerificationProfile withQualifyingPropertyVerifier(Class<TData> propDataClass,
Class<? extends QualifyingPropertyVerifier<TData>> verifierClass)
public <TData extends PropertyDataObject> XadesVerificationProfile withQualifyingPropertyVerifier(Class<TData> propDataClass,
QualifyingPropertyVerifier<TData> verifier)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||