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

  • Home
  • SEARCH
  • 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 702087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:40:54+00:00 2026-05-14T03:40:54+00:00

I am trying to parse a X509 Certificate that contains a Digital Signature Algorithm

  • 0

I am trying to parse a X509 Certificate that contains a Digital Signature Algorithm (DSA) public key.

Using the javax.security.cert.X509Certificate class and getPublicKey() method I’ve been able to get P, Q, G and Y:

P: 0279b05d bd36b49a 6c6bfb2d 2e43da26 052ee59d f7b5ff38 f8288907 2f2a5d8e 2acad76e ec8c343e eb96edee 11
Q: 036de1
G: 03 
Y: 02790a25 22838207 4fa06715 1def9df5 474b5d84 a28b2b9b 360a7fc9 086fb2c6 9aab148f e8372ab8 66705884 6d

However, I’m not sure what format this is and how to parse it to convert it to long\BigInteger in Java.

Does anybody know how to do this conversion?

I am currently assuming it is Hex and I am parsing it as so – but I’m not 100% sure if this is correct.

  • 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-14T03:40:54+00:00Added an answer on May 14, 2026 at 3:40 am

    You should already have the big integers. Here is how it goes for me:

    X509Certificate xc = X509Certificate.getInstance(ecert);
    PublicKey pkey = xc.getPublicKey();
    DSAPublicKey dk = (DSAPublicKey)pkey;
    DSAParams pp = dk.getParams();
    System.out.printf("p = 0x%X\n", pp.getP());
    System.out.printf("q = 0x%X\n", pp.getQ());
    System.out.printf("g = 0x%X\n", pp.getG());
    System.out.printf("y = 0x%X\n", dk.getY());
    

    assuming the encoded certificate is in ecert. Interfaces DSAPublicKey and DSAParams are in java.security.interfaces.

    You can also go through a KeyFactory and use the getKeySpec() method to export the public key as a DSAPublicKeySpec, which will offer the same values as BigInteger instances. I am not sure if there is a gain to go through that road, though.

    What you show is probably some kind of encoding, but I am quite at a loss to know which one. Anyway, the ‘Q’ parameter shall be at least 160-bit wide in a proper DSA public key.

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

Sidebar

Ask A Question

Stats

  • Questions 345k
  • Answers 345k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I haven't tried this, but this module sounds like it… May 14, 2026 at 5:50 am
  • Editorial Team
    Editorial Team added an answer If you'll extend from the mysqli_stmt class you'll bypass the… May 14, 2026 at 5:50 am
  • Editorial Team
    Editorial Team added an answer That is the intent. The idea here is that you… May 14, 2026 at 5:50 am

Related Questions

I am trying to parse a set of lines read from a file in
I am trying to parse a column of strings in Oracle (version 8i) to
I am trying to parse a multi line string and get the rest of
I am trying to parse a xml file that i have (using javascript DOM).
I am trying to parse a heavily namespaced SOAP message (source can be found

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.