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 8109233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:21:18+00:00 2026-06-06T01:21:18+00:00

I have to validate two SAML 2.0 assertion signatures. I can parse out all

  • 0

I have to validate two SAML 2.0 assertion signatures. I can parse out all the key and token parameters and now want to use the .NET CryptoUtils.VerifySignature() or some other function to validate the signatures. I have the text that was signed and the signature as a byte[] array as well as the hash OID. I have the RSA and SAML token parameters such as the Signature Value, modulus, exponent, etc. What I’m missing is the x509 cert to send into the .NET VerifySignature() routine. I can’t see how to create the cert programmatically from the parameters.

I’d also appreciate any suggestions on a library, c# and Java, that will handle creating, parsing, validating SAML 2.0 tokens (requests and responses).

  • 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-06T01:21:19+00:00Added an answer on June 6, 2026 at 1:21 am

    In C#, you can use…

    System.Security.Cryptography.Xml.SignedXml.CheckSignature(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, bool verifySignatureOnly)

    …to validate the signature. Basically, it would work like this:

     using System.Xml;
     using System.Security.Cryptography.X509Certificates;
     using System.Security.Cryptography.Xml;
     using System.Text;
    
     namespace MySamlDocumentExample
     {
         public class Saml20Transaction : SignedXml
         {
             public Saml20Transaction(XmlDocument doc) 
                 : base (doc)
             {
    
             }
         }
    
         public class SamlVerifier
         {
             readonly XmlDocument _mySamlDocument = new XmlDocument();
    
             public SamlVerifier(string saml)
             {
                 _mySamlDocument.LoadXml(saml);
             }
    
             public X509Certificate2 X509Certificate
             {
                 get
                 {
                     return new X509Certificate2(
                         Encoding.ASCII.GetBytes(X509CertificateString));
                 }
             }
    
             public string X509CertificateString
             {
                 get
                 {
                     XmlNodeList xmlNodeList = _mySamlDocument.GetElementsByTagName("X509Certificate");
                     return xmlNodeList[0].InnerText;
                 }
             }
    
             public bool ValidateSignature()
             {
                 Saml20Transaction saml20Transaction = new Saml20Transaction(_mySamlDocument);
                 XmlNodeList xmlNodeList = _mySamlDocument.GetElementsByTagName("Signature");
                 saml20Transaction.LoadXml((XmlElement)xmlNodeList[0]);
                 return saml20Transaction.CheckSignature(X509Certificate, true);
             }
         }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two websites.I want to validate,if the person who is signing in the
I have the following code to validate two text box entries to make sure
I have two asp.net textboxes and need to put a validate function in javascript
I have to validate username in my app so that it cannot contain two
As you all know Compare validators can be used to validate dates and check
i want to validate uniqueness of two filed but if second filed is nil
I have two validation scripts which work in their own right, but I now
I have two regular expressions that I use to validate Colorado driver's license formats.
I have two logical groups of input fields I need to validate separately using
I have two textboxes. I need to validate them before taking any other action.

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.