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 aSignatureinstance. 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 SignerProvidersignerInstanceThe cached signer provider instance to use.
-
Constructor Summary
Constructors Modifier Constructor Description protectedSigner()Constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static org.slf4j.LoggergetLogger()Get an SLF4J Logger.private static SignerProvidergetSignerProvider()Obtain theSignerProviderinstance to be used.static voidsignObject(Signature signature)Signs a single XMLObject.static voidsignObjects(List<Signature> signatures)Signs the given XMLObject in the order provided.
-
-
-
Field Detail
-
signerInstance
private static SignerProvider signerInstance
The cached signer provider instance to use.
-
-
Method Detail
-
signObjects
public static void signObjects(@Nonnull List<Signature> signatures) throws SignatureExceptionSigns 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 SignatureExceptionSigns 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 theSignerProviderinstance to be used.- Returns:
- the SignerProvider
- Throws:
SignatureException- if a SignerProvider could not be loaded
-
getLogger
@Nonnull private static org.slf4j.Logger getLogger()
Get an SLF4J Logger.- Returns:
- a Logger instance
-
-