Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7964729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:57:46+00:00 2026-06-04T05:57:46+00:00

I am using ml signatures in my program to check if the message has

  • 0

I am using ml signatures in my program to check if the message has been tampered with and to check if it has been signed by a valid person. The second part I understood. The problem is with the first part- i.e checking the reference validity. Here is the code that I am using. xmldoc is a document object containing the xml enveloped signature.

 NodeList nl = xmldoc.getElementsByTagNameNS
      (XMLSignature.XMLNS, "Signature");

    DOMValidateContext valContext = new DOMValidateContext
      (pbk1, nl.item(0)); 

As you can see the valContext contains only the signature element and the public key(this will be needed to verify the signature). But in the code below you can see that only by using the valContext object, the reference is validated. How is this possible? To validate the reference, it need to have access to the actual xmldoc from where it can extract the elements referenced in <reference> and then find the hash/digest of its values and compare them wih the <digest value>.
But somehow the code below works. I don’t know how? Someone please explain.

Iterator i =
      signature1.getSignedInfo().getReferences().iterator();
    for (int j=0; i.hasNext(); j++) {
      boolean refValid = ((Reference) 
        i.next()).validate(valContext);
      System.out.println("ref["+j+"] validity status: " + 
        refValid);
    } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:57:47+00:00Added an answer on June 4, 2026 at 5:57 am

    A DOM Node object for an element is not just the element, it is the element as contained in the whole XML document. If you look at the Node interface documentation, you’ll notice a method called getOwnerDocument(). So from the Node that you passed to your DOMValidateContext object, it is possible to access the whole XML document, and thus any content in that document that is referred to inside your Signature element.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone using .net actually worked out how to successfully sign a signature to
Without any preamble I want to show you problem I have in my program,
I am trying to convert my program from using Data.Array to Data.Array.Unboxed. As a
I am using CPPUnit to test a class in my program. This class (
I want to put all the signatures of Windows API functions I'm using in
In my ml program I am using nested structures to structure my code. I'm
I've been using dynamic libraries and GetProcAddress stuff for quite some time, but it
Here's an interesting problem: I'm using ReadProcessMemory (from within C#) to write a simple
Anyone know how to do this without using a third party program? If there
I am using vb.net 2010 and I have created a program that uses sockets

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.