Class XMLSigner


  • public class XMLSigner
    extends java.lang.Object
    Class containing help methods for digital XML signatures
    • Field Detail

      • XMLDSIG_NAMESPACE

        public static java.lang.String XMLDSIG_NAMESPACE
    • Constructor Detail

      • XMLSigner

        @Deprecated
        public XMLSigner​(MessageSecurityProvider messageSecurityProvider,
                         javax.xml.parsers.DocumentBuilder documentBuilder,
                         boolean signMessages,
                         XMLSigner.SignatureLocationFinder defaultSignatureLocationFinder,
                         XMLSigner.OrganisationLookup defaultOrganisationLookup)
                  throws MessageProcessingException
        Deprecated.
        This constructor will result in an XMLSigner instance that is not thread safe, please use constructor that does not explicitly specify an existing DocumentBuilder instance.
        Constructor used for context based message security providers using an existing DocumentBuilder instance.
        Parameters:
        messageSecurityProvider - MessageSecurityProvider instance to use.
        documentBuilder - DocumentBuilder to use when processing and parsing XML
        signMessages - If messages should be signed or not.
        defaultSignatureLocationFinder - SignatureLocationFinder instance to use.
        defaultOrganisationLookup - OrganisationLookup instance to use.
        Throws:
        MessageProcessingException - If an error occurs while performing signature operation.
      • XMLSigner

        public XMLSigner​(MessageSecurityProvider messageSecurityProvider,
                         boolean signMessages,
                         XMLSigner.SignatureLocationFinder defaultSignatureLocationFinder,
                         XMLSigner.OrganisationLookup defaultOrganisationLookup)
                  throws MessageProcessingException
        Constructor used for context based message security providers.
        Parameters:
        messageSecurityProvider - MessageSecurityProvider instance to use.
        signMessages - If messages should be signed or not.
        defaultSignatureLocationFinder - SignatureLocationFinder instance to use.
        defaultOrganisationLookup - OrganisationLookup instance to use.
        Throws:
        MessageProcessingException - If an error occurs while performing signature operation.
    • Method Detail

      • verifyEnvelopedSignature

        @Deprecated
        public void verifyEnvelopedSignature​(byte[] message)
                                      throws MessageContentException,
                                             MessageProcessingException
        Deprecated.
        Help method to verify a signed enveloped message and performs the following checks. Using the default context.
      • That the signature if included X509Certificate verifies.
      • That the signatures algorithms is one of supported signature schemes.
      • That the signature method is enveloped.

        This method does not perform and authorization call towards message security provider.

Parameters:
message - the message to verify signature of.
Throws:
MessageContentException - if message content was faulty
MessageProcessingException - if internal error occurred verifying the signature.
Parameters:
context - the related message security context
message - the message to verify signature of.
Throws:
MessageContentException - if message content was faulty
MessageProcessingException - if internal error occurred verifying the signature.