Package org.opensaml.xmlsec.signature.support

# Class Signer

java.lang.Object
org.opensaml.xmlsec.signature.support.Signer

public final class Signer extends Object
A service class which is responsible for cryptographically computing and storing the actual digital signature content held within a `Signature` instance. This must be done as a separate step in order to support the following cases:

- Multiple signable objects appear in the DOM tree, in which case the order that the objects should be signed in is not known (e.g. object 1 could appear first in the tree, but contain a reference to signable object 2)
- The DOM tree resulting from marshalling of the XMLObject tree is grafted onto another DOM tree which may cause element ID conflicts that would invalidate the signature

## Field Summary

Fields
Modifier and Type
Field
Description
`private static final org.slf4j.Logger`
`LOG`
Logger.
`private static SignerProvider`
`signerInstance`
The cached signer provider instance to use.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`Signer()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`private static SignerProvider`
`getSignerProvider()`
Obtain the `SignerProvider` instance to be used.
`static void`
`signObject(Signature signature)`
Signs a single XMLObject.
`static void`
`signObjects(List<Signature> signatures)`
Signs the given XMLObject in the order provided.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### LOG

@Nonnull private static final org.slf4j.Logger LOG
Logger.

### signerInstance

@Nullable private static SignerProvider signerInstance
The cached signer provider instance to use.

## Constructor Details

### Signer

protected Signer()
Constructor.

## Method Details

### signObjects

public static void signObjects(@Nonnull List<Signature> signatures) throws SignatureException
Signs the given XMLObject in the order provided.

Parameters:
  `signatures` - an ordered list of XMLObject to be signed
Throws:
  `SignatureException` - thrown if there is an error computing the signature

### signObject

public static void signObject(@Nonnull Signature signature) throws SignatureException
Signs a single XMLObject.

Parameters:
  `signature` - the signature to compute the signature on
Throws:
  `SignatureException` - thrown if there is an error computing the signature

### getSignerProvider

@Nonnull private static SignerProvider getSignerProvider() throws SignatureException
Obtain the `SignerProvider` instance to be used.

Returns:
  the SignerProvider
Throws:
  `SignatureException` - if a SignerProvider could not be loaded