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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:09:43+00:00 2026-06-13T02:09:43+00:00

You can construct a X509AsymmetricSecurityKey from a X509Certificate2 instance using the X509AsymmetricSecurityKey(X509Certificate2) constructor; but

  • 0

You can construct a X509AsymmetricSecurityKey from a X509Certificate2 instance using the X509AsymmetricSecurityKey(X509Certificate2) constructor; but can get the X509Certificate2 instance from the security key?

As a parallel example, the InMemorySymmetricSecurityKey class exposes a GetSymmetricKey() method that can be used to retrieve the symmetric key.

I had hoped to see an equivalent method like GetCertificate() exposed by the X509AsymmetricSecurityKey class, but the closest method I see is GetAsymmetricAlgorithm(string algorithm, bool privateKey).

What I am really after is the ability to verify the digital signature of a message that was signed using the private key of the certificate, which means the signature is verified using the public key of the certificate.

Is there a way to verify the signature using the asymmetric algorithm of the security key?

  • 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-13T02:09:44+00:00Added an answer on June 13, 2026 at 2:09 am

    While owlstead was correct that you cannot retrieve the X.509 certificate from the security key; what I should have indicated was that I was attempting to verify a digital signature of a JSON web token where the security key contained the public portion of the public-private key pair.

    You can in fact use the security key to verify the signature. The following is an example of how to generally go about it:

    var data        = {Get data that was signed as an array of bytes}
    var signature   = {Get signature as an array of bytes}
    
    // key variable is of type X509AsymmetricSecurityKey
    
    using(var rsa = key.GetAsymmetricAlgorithm(SecurityAlgorithms.RsaSha256Signature, false) as RSACryptoServiceProvider)
    {
        if(rsa != null)
        {
            using(var halg = new SHA256CryptoServiceProvider())
            {
                if (!rsa.VerifyData(data, halg, signature))
                {
                    throw new SecurityException("Signature is invalid.");
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can construct a QGraphicsScene by using constructor below: QGraphicsScene::QGraphicsScene ( qreal x, qreal
Is there any way I can construct an new object from the given object
In python, I can construct my optparse instance such that it will automatically filter
How can I construct an object using a query if I also need to
I know that from a general tree you can construct a unique binary tree,
For example we can construct such an array like this: new ElementType[0]; I seen
The following is the best minimum working example I can construct for now. I
I can construct an array with: array ((0,0),(10,10)) [((x,y),(x)) | x<-[0..10], y<-[0..10]] but I
This states I can construct a vector from an array as follows: // the
Using wso2 esb i can construct a complete soap message like this: <enrich> <source

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.