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

      • signerInstance

        private static SignerProvider signerInstance
        The cached signer provider instance to use.
    • Constructor Detail

      • Signer

        protected Signer()
        Constructor.
    • Method Detail

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

        @Nonnull
        private static org.slf4j.Logger getLogger()
        Get an SLF4J Logger.
        Returns:
        a Logger instance