Class XadesSigningProfile
- Direct Known Subclasses:
XadesBesSigningProfile
,XadesEpesSigningProfile
,XadesTSigningProfile
The purpose of this class is to configure a XadesSigner
that will actually
produce signatures with those characteristics.
Only a KeyingDataProvider
has to externally be supplied. 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 XadesSigner
. 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 PropertyDataObjectGenerator
s can also be configured. The principles
on their dependencies are the same.
The XAdES form is also part of the profile. Each form has additional requirements,
hence being defined by a specific subclass. There are profiles up to XAdES-C.
The extended formats are also supported (with a few limitations) but can only
be added after verfication (XadesVerifier
).
Repeated dependency bindings will not cause an immediate error. An exception
will be thrown when an instance of XadesSigner
is requested.
- Author:
- Luís
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
XadesSigningProfile
(Class<? extends KeyingDataProvider> keyingProviderClass) protected
XadesSigningProfile
(KeyingDataProvider keyingProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Class<? extends XadesSigner>
final XadesSigner
Creates a newXadesSigner
based on the current state of the profile.final XadesSigningProfile
Adds an instance dependency mapping to the profile, using the instance type as dependency.final <T> XadesSigningProfile
withBinding
(Class<T> from, Class<? extends T> to) Adds a type dependency mapping to the profile.final <T> XadesSigningProfile
withBinding
(Class<T> from, T to) Adds a instance dependency mapping to the profile.withDataObjectPropertiesProvider
(Class<? extends DataObjectPropertiesProvider> dataObjPropsProviderClass) withDataObjectPropertiesProvider
(DataObjectPropertiesProvider dataObjPropsProvider) withDigestEngineProvider
(Class<? extends MessageDigestEngineProvider> digestProviderClass) withDigestEngineProvider
(MessageDigestEngineProvider digestProvider) protected final <T> XadesSigningProfile
withOptionalBinding
(Class<T> clazz) <TProp extends QualifyingProperty>
XadesSigningProfilewithPropertyDataObjectGenerator
(Class<TProp> propClass, Class<? extends PropertyDataObjectGenerator<TProp>> propDataGenClass) <TProp extends QualifyingProperty>
XadesSigningProfilewithPropertyDataObjectGenerator
(Class<TProp> propClass, PropertyDataObjectGenerator<TProp> propDataGen) withSignatureAlgorithms
(SignatureAlgorithms algorithms) withSignaturePropertiesProvider
(Class<? extends SignaturePropertiesProvider> signaturePropsProvClass) withSignaturePropertiesProvider
(SignaturePropertiesProvider signaturePropsProv) withSignedPropertiesMarshaller
(Class<? extends SignedPropertiesMarshaller> sPropsMarshallerClass) withSignedPropertiesMarshaller
(SignedPropertiesMarshaller sPropsMarshaller) withTimeStampTokenProvider
(Class<? extends TimeStampTokenProvider> tsTokenProviderClass) withTimeStampTokenProvider
(TimeStampTokenProvider tsTokenProvider) withUnsignedPropertiesMarshaller
(Class<? extends UnsignedPropertiesMarshaller> uPropsMarshallerClass) withUnsignedPropertiesMarshaller
(UnsignedPropertiesMarshaller uPropsMarshaller) withX500NameStyleProvider
(Class<? extends X500NameStyleProvider> x500NameStyleProviderClass) Experimental API.withX500NameStyleProvider
(X500NameStyleProvider x500NameStyleProvider) Experimental API.
-
Constructor Details
-
XadesSigningProfile
-
XadesSigningProfile
-
-
Method Details
-
newSigner
Creates a newXadesSigner
based on the current state of the profile. If any changes are made after this call, the previously returned signer will not be affected. Other signers can be created, accumulating the profile changes.- Returns:
- a
XadesSigner
accordingly to this profile - Throws:
XadesProfileResolutionException
- if the dependencies of the signer (direct and indirect) cannot be resolved
-
getSignerClass
-
withOptionalBinding
-
withBinding
Adds a type dependency mapping to the profile. This is tipically done from an interface to a type that implements that interface. When a dependency tofrom
is found, theto
class is used. Theto
class may in turn have its own dependencies.The other
withNNNNNN
methods are convenient shortcuts for this one.- Parameters:
from
- the dependencyto
- the type that resolves the dependency- Returns:
- this profile
-
withBinding
Adds a instance dependency mapping to the profile. When a dependency tofrom
is found, theto
instance is used. The otherwithNNNNNN
methods are convenient shortcuts for this one.- Parameters:
from
- the dependencyto
- the instance that resolves the dependency- Returns:
- this profile
-
with
Adds an instance dependency mapping to the profile, using the instance type as dependency.- Parameters:
instance
- the instance that resolves the dependency- Returns:
- this profile
-
withSignatureAlgorithms
-
withDigestEngineProvider
-
withDigestEngineProvider
public XadesSigningProfile withDigestEngineProvider(Class<? extends MessageDigestEngineProvider> digestProviderClass) -
withX500NameStyleProvider
Experimental API. It may be changed or removed in future releases. -
withX500NameStyleProvider
public XadesSigningProfile withX500NameStyleProvider(Class<? extends X500NameStyleProvider> x500NameStyleProviderClass) Experimental API. It may be changed or removed in future releases. -
withBasicSignatureOptions
-
withSignaturePropertiesProvider
public XadesSigningProfile withSignaturePropertiesProvider(SignaturePropertiesProvider signaturePropsProv) -
withSignaturePropertiesProvider
public XadesSigningProfile withSignaturePropertiesProvider(Class<? extends SignaturePropertiesProvider> signaturePropsProvClass) -
withDataObjectPropertiesProvider
public XadesSigningProfile withDataObjectPropertiesProvider(DataObjectPropertiesProvider dataObjPropsProvider) -
withDataObjectPropertiesProvider
public XadesSigningProfile withDataObjectPropertiesProvider(Class<? extends DataObjectPropertiesProvider> dataObjPropsProviderClass) -
withTimeStampTokenProvider
-
withTimeStampTokenProvider
public XadesSigningProfile withTimeStampTokenProvider(Class<? extends TimeStampTokenProvider> tsTokenProviderClass) -
withSignedPropertiesMarshaller
public XadesSigningProfile withSignedPropertiesMarshaller(SignedPropertiesMarshaller sPropsMarshaller) -
withSignedPropertiesMarshaller
public XadesSigningProfile withSignedPropertiesMarshaller(Class<? extends SignedPropertiesMarshaller> sPropsMarshallerClass) -
withUnsignedPropertiesMarshaller
public XadesSigningProfile withUnsignedPropertiesMarshaller(UnsignedPropertiesMarshaller uPropsMarshaller) -
withUnsignedPropertiesMarshaller
public XadesSigningProfile withUnsignedPropertiesMarshaller(Class<? extends UnsignedPropertiesMarshaller> uPropsMarshallerClass) -
withPropertyDataObjectGenerator
public <TProp extends QualifyingProperty> XadesSigningProfile withPropertyDataObjectGenerator(Class<TProp> propClass, PropertyDataObjectGenerator<TProp> propDataGen) -
withPropertyDataObjectGenerator
public <TProp extends QualifyingProperty> XadesSigningProfile withPropertyDataObjectGenerator(Class<TProp> propClass, Class<? extends PropertyDataObjectGenerator<TProp>> propDataGenClass)
-