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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:53:45+00:00 2026-05-25T12:53:45+00:00

I have an X509Certificate accessed by a variable … when i try to get

  • 0

I have an X509Certificate accessed by a variable …
when i try to get the details of the certificate i manage to get the CriticalExtensions value easly by the functions provided.
however what i’m trying to reach is the none critical extension which is stored in certifcate and represented by Object ID # 2.5.29.32

what i’m trying to access is the policy identifier number which is show in this image: https://i.stack.imgur.com/xo8zX.png

i used the following function

cert.getExtensionValue("2.5.29.32");

but it doesn’t give me the value .. anyone can tell me what i’m doing wrong ?

P.S: i’m using the java.security.cert.X509Certificate;

  • 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-25T12:53:46+00:00Added an answer on May 25, 2026 at 12:53 pm

    Found the issue .

    The returned value was DER Octet encoded value which needed to be decoded, here is the code i used to decode the value :

    import org.bouncycastle.asn1.DERObject;
    import org.bouncycastle.asn1.DEROctetString;
    import org.bouncycastle.asn1.ASN1InputStream;
    .
    .
    .
    .
    byte[] UID =  cert.getExtensionValue("2.5.29.32");
    
    DERObject derObject = toDERObject(UID);
    
    if (derObject instanceof DEROctetString)
    {
        DEROctetString derOctetString = (DEROctetString)derObject;
        derObject = toDERObject(derOctetString.getOctets());
    
    }
    System.out.println(derObject.toString());
    

    And this is the function to convert DER to object.

    Static public DERObject toDERObject(byte[] data) throws IOException
    {
        ByteArrayInputStream inStream = new ByteArrayInputStream(data);
        ASN1InputStream DIS = new ASN1InputStream(inStream);
        return DIS.readObject();
    } 
    

    Hope this helps someone in need .

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

Sidebar

Related Questions

I have an X.509 certificate and need to get the size of its key
Have you managed to get Aptana Studio debugging to work? I tried following this,
I have an ASP.NET application that accesses private key in a certificate in the
i have an X509Certificate that i want to add extensions to... i want to
I have a X509 Certificate and I want to store it in a MySQL
I have been issued a PKCS#12 certificate to be used for accessing a simple
Backstory: I have a PKCS#12 (p12) certificate with a symmetric cipher (password) that I
I try to get Key from KeyStore. I created a keystore by Keytool: keytool
I am trying to validate an X.509 certificate using C# and .NetCF. I have
I'm trying to get the certificate out of XMLSignature, get it's CRL DistributionPoint and

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.