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