public abstract class

XadesSigningProfile

extends Object
java.lang.Object
   ↳ xades4j.production.XadesSigningProfile
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

A profile for signature production. This class and its subclasses are the entry point for producing signatures. A profile is a configuration for the signature production process. This includes not only characteristics of the signer and the signature, such as the signing key/certificate and signature properties, but also components for the process itself, such as digest and time-stamp generation.

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 PropertyDataObjectGenerators 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.

Summary

Protected Constructors
XadesSigningProfile(KeyingDataProvider keyingProvider)
XadesSigningProfile(Class<? extends KeyingDataProvider> keyingProviderClass)
Public Methods
final XadesSigner newSigner()
Creates a new XadesSigner based on the current state of the profile.
XadesSigningProfile withAlgorithmsProvider(AlgorithmsProvider algsProvider)
This method is deprecated.

This method is deprecated and might be removed on future versions. Classes registered using this method will be adapted to the new AlgorithmsProviderEx interface. AlgorithmsProvider and AlgorithmsProviderEx cannot be registered simultaneously on the same profile.

XadesSigningProfile withAlgorithmsProvider(Class<? extends AlgorithmsProvider> algsProviderClass)
This method is deprecated.

This method is deprecated and might be removed on future versions. Classes registered using this method will be adapted to the new AlgorithmsProviderEx interface. AlgorithmsProvider and AlgorithmsProviderEx cannot be registered simultaneously on the same profile.

XadesSigningProfile withAlgorithmsProviderEx(AlgorithmsProviderEx algsProvider)
XadesSigningProfile withAlgorithmsProviderEx(Class<? extends AlgorithmsProviderEx> algsProviderClass)
XadesSigningProfile withBasicSignatureOptionsProvider(BasicSignatureOptionsProvider optionsProvider)
XadesSigningProfile withBasicSignatureOptionsProvider(Class<? extends BasicSignatureOptionsProvider> optionsProvider)
final <T> XadesSigningProfile withBinding(Class<T> from, T to)
Adds a instance dependency mapping to the profile.
final <T> XadesSigningProfile withBinding(Class<T> from, Class<? extends T> to)
Adds a type dependency mapping to the profile.
XadesSigningProfile withDataObjectPropertiesProvider(DataObjectPropertiesProvider dataObjPropsProvider)
XadesSigningProfile withDataObjectPropertiesProvider(Class<? extends DataObjectPropertiesProvider> dataObjPropsProviderClass)
XadesSigningProfile withDigestEngineProvider(Class<? extends MessageDigestEngineProvider> digestProviderClass)
XadesSigningProfile withDigestEngineProvider(MessageDigestEngineProvider digestProvider)
<TProp extends QualifyingProperty> XadesSigningProfile withPropertyDataObjectGenerator(Class<TProp> propClass, Class<? extends PropertyDataObjectGenerator<TProp>> propDataGenClass)
<TProp extends QualifyingProperty> XadesSigningProfile withPropertyDataObjectGenerator(Class<TProp> propClass, PropertyDataObjectGenerator<TProp> propDataGen)
XadesSigningProfile withSignaturePropertiesProvider(SignaturePropertiesProvider signaturePropsProv)
XadesSigningProfile withSignaturePropertiesProvider(Class<? extends SignaturePropertiesProvider> signaturePropsProvClass)
XadesSigningProfile withSignedPropertiesMarshaller(Class<? extends SignedPropertiesMarshaller> sPropsMarshallerClass)
XadesSigningProfile withSignedPropertiesMarshaller(SignedPropertiesMarshaller sPropsMarshaller)
XadesSigningProfile withTimeStampTokenProvider(TimeStampTokenProvider tsTokenProvider)
XadesSigningProfile withTimeStampTokenProvider(Class<? extends TimeStampTokenProvider> tsTokenProviderClass)
XadesSigningProfile withUnsignedPropertiesMarshaller(Class<? extends UnsignedPropertiesMarshaller> uPropsMarshallerClass)
XadesSigningProfile withUnsignedPropertiesMarshaller(UnsignedPropertiesMarshaller uPropsMarshaller)
Protected Methods
abstract Class<? extends XadesSigner> getSignerClass()
[Expand]
Inherited Methods
From class java.lang.Object

Protected Constructors

protected XadesSigningProfile (KeyingDataProvider keyingProvider)

protected XadesSigningProfile (Class<? extends KeyingDataProvider> keyingProviderClass)

Public Methods

public final XadesSigner newSigner ()

Creates a new XadesSigner based on the current state of the profile. If any changes are made after this call, the previously returned signer will not be afected. 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

public XadesSigningProfile withAlgorithmsProvider (AlgorithmsProvider algsProvider)

This method is deprecated.

This method is deprecated and might be removed on future versions. Classes registered using this method will be adapted to the new AlgorithmsProviderEx interface. AlgorithmsProvider and AlgorithmsProviderEx cannot be registered simultaneously on the same profile.

public XadesSigningProfile withAlgorithmsProvider (Class<? extends AlgorithmsProvider> algsProviderClass)

This method is deprecated.

This method is deprecated and might be removed on future versions. Classes registered using this method will be adapted to the new AlgorithmsProviderEx interface. AlgorithmsProvider and AlgorithmsProviderEx cannot be registered simultaneously on the same profile.

public XadesSigningProfile withAlgorithmsProviderEx (AlgorithmsProviderEx algsProvider)

public XadesSigningProfile withAlgorithmsProviderEx (Class<? extends AlgorithmsProviderEx> algsProviderClass)

public XadesSigningProfile withBasicSignatureOptionsProvider (BasicSignatureOptionsProvider optionsProvider)

public XadesSigningProfile withBasicSignatureOptionsProvider (Class<? extends BasicSignatureOptionsProvider> optionsProvider)

public final XadesSigningProfile withBinding (Class<T> from, T to)

Adds a instance dependency mapping to the profile. When a dependency to from is found, the to instance is used. The other withNNNNNN methods are convenient shortcuts for this one.

Parameters
from the dependency
to the instance that resolves the dependency
Returns
  • this profile

public final XadesSigningProfile withBinding (Class<T> from, Class<? extends T> to)

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 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.

Parameters
from the dependency
to the type that resolves the dependency
Returns
  • this profile

public XadesSigningProfile withDataObjectPropertiesProvider (DataObjectPropertiesProvider dataObjPropsProvider)

public XadesSigningProfile withDataObjectPropertiesProvider (Class<? extends DataObjectPropertiesProvider> dataObjPropsProviderClass)

public XadesSigningProfile withDigestEngineProvider (Class<? extends MessageDigestEngineProvider> digestProviderClass)

public XadesSigningProfile withDigestEngineProvider (MessageDigestEngineProvider digestProvider)

public XadesSigningProfile withPropertyDataObjectGenerator (Class<TProp> propClass, Class<? extends PropertyDataObjectGenerator<TProp>> propDataGenClass)

public XadesSigningProfile withPropertyDataObjectGenerator (Class<TProp> propClass, PropertyDataObjectGenerator<TProp> propDataGen)

public XadesSigningProfile withSignaturePropertiesProvider (SignaturePropertiesProvider signaturePropsProv)

public XadesSigningProfile withSignaturePropertiesProvider (Class<? extends SignaturePropertiesProvider> signaturePropsProvClass)

public XadesSigningProfile withSignedPropertiesMarshaller (Class<? extends SignedPropertiesMarshaller> sPropsMarshallerClass)

public XadesSigningProfile withSignedPropertiesMarshaller (SignedPropertiesMarshaller sPropsMarshaller)

public XadesSigningProfile withTimeStampTokenProvider (TimeStampTokenProvider tsTokenProvider)

public XadesSigningProfile withTimeStampTokenProvider (Class<? extends TimeStampTokenProvider> tsTokenProviderClass)

public XadesSigningProfile withUnsignedPropertiesMarshaller (Class<? extends UnsignedPropertiesMarshaller> uPropsMarshallerClass)

public XadesSigningProfile withUnsignedPropertiesMarshaller (UnsignedPropertiesMarshaller uPropsMarshaller)

Protected Methods

protected abstract Class<? extends XadesSigner> getSignerClass ()