Class SignatureHelper


  • public final class SignatureHelper
    extends Object
    Classes to assist with signature operations.
    • Field Detail

      • STRIP_CR_ELEMENTS

        private static final List<String> STRIP_CR_ELEMENTS
        Elements which should be examined for CRs, and stripped of them.
      • ENSURE_NL_ELEMENTS

        private static final List<String> ENSURE_NL_ELEMENTS
        Elements which should be forced into a NL - value - NL format.
    • Constructor Detail

      • SignatureHelper

        private SignatureHelper()
        Constructor.
    • Method Detail

      • removeCRsFromNamedChildren

        private static void removeCRsFromNamedChildren​(@Nonnull
                                                       Element signature,
                                                       @Nonnull
                                                       String elementName)
        Remove any CRs from the text content of named child elements.
        Parameters:
        signature - The Signature element to process.
        elementName - The element name within the XML DSIG namespace to look for.
      • ensureNLsWrapNamedChildren

        private static void ensureNLsWrapNamedChildren​(@Nonnull
                                                       Element signature,
                                                       @Nonnull
                                                       String elementName)
        Ensure a named child element is in a NL - value - NL format.
        Parameters:
        signature - The Signature element to process.
        elementName - The element name within the XML DSIG namespace to look for.
      • postProcessSignature

        public static void postProcessSignature​(@Nonnull
                                                Element signatureElement)
        Post-process a generated signature.
        Parameters:
        signatureElement - DOM Element containing the signature