Class Signer
java.lang.Object
org.opensaml.xmlsec.signature.support.Signer
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
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.LoggerLogger.private static SignerProviderThe cached signer provider instance to use. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static SignerProviderObtain 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 Details
-
LOG
@Nonnull private static final org.slf4j.Logger LOGLogger. -
signerInstance
The cached signer provider instance to use.
-
-
Constructor Details
-
Signer
protected Signer()Constructor.
-
-
Method Details
-
signObjects
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
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
Obtain theSignerProviderinstance to be used.- Returns:
- the SignerProvider
- Throws:
SignatureException- if a SignerProvider could not be loaded
-