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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:11:08+00:00 2026-05-31T00:11:08+00:00

I have a certificate ( X509Certificate2 ) in my app, and I can enumerate

  • 0

I have a certificate (X509Certificate2) in my app, and I can enumerate all certificate’s extensions. One of those extensions is Certificate Policies, with OID 2.5.29.32. This extension is supposed to be just a sequence of OID’s, and I need to search for specific OID’s there. The problem is that this extension is coded as DER octet string. How can I get to the OID inside that I’m interested in? Do I have to manually parse a DER octet string? How can I do that?

EDIT: I’m going to see what Bouncy Castle has to offer, but I’m wondering if there is a ready solution in .NET framework. Framework parses certificates and other DER structures, so there might be DER decoder built in.

BOUNTY: I have found a solution for me, but I’m looking for improvements. Bounty goes to other solution if it satisfies one or more of the following, sorted by relevance:

  1. it uses standard .NET library functions
  2. it uses mature or proven source code or library, smaller than Bouncy Castle (I need only parsing, not the all the rest)
  3. it merely improves on the code I already have, in a matter that I find worthy

BUMP: Bounty expires today. If no one else provides an answer it’ll go to GalacticJello.

  • 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-05-31T00:11:09+00:00Added an answer on May 31, 2026 at 12:11 am

    I had this problem a year ago.
    I found a small library that helped me a lot (site). This library transforms the file key in xml (using a .exe) and then we could read it on C#.

    I didn’t liked to transform my key in XML. I asked for the library’s developer to use the opensource code in my project, fortunately he accepted. So I built a fork that do exactly what I needed.

    After a long time, I have found another implementation in Mono project, avaiable here.

    A helper class that uses CryptoLib here and an example here:

    public IRegistryService Connect(String name, RSACryptoServiceProvider privateKey, X509Certificate2 acsCertificate) {
      if ((String.IsNullOrEmpty(name)) || (acsCertificate == null) || (privateKey == null))
        throw new ArgumentException("....");
    
      if (!String.IsNullOrEmpty(this.Credential.identifier))
        throw new ACSLoginFailureException("....");
    
      byte[] challenge = this.acs.getChallenge(name);      
      byte[] answer = new byte[0];
      try {
        answer = Crypto.GenerateAnswer(challenge, privateKey, acsCertificate);
      }
      catch (CryptographicException e) {
        throw new ACSLoginFailureException("....", e);
      }
    
      bool connect = this.acs.loginByCertificate(name, answer, out this.credential, out leaseTime);      
    
      // ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have received a X509 certificate (one .cer file), I can decode it, so
I have a certificate in der format, from it with this command I generate
I have a certificate code sign and an app mobileprovision for a mac. Is
Maybe someone can clear me up. I have been surfing on this a while
I thought this would be straightforward but apparently it isn't. I have a certificate
I have an X509Certificate2 certificate in my store that I would like to export
I have certificate created using java class CertAndKeyGen and X500Name and I am able
I have a certificate issued by a CA on our intranet (it's a V3
I have a certificate .p12 and .crt and I would like store the public
I have a PFX certificate which I use to read encrypted email in outlook.

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.