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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:40:07+00:00 2026-05-27T13:40:07+00:00

I use KeyPairGenerator class to generate private and public key for RSA algorithm. Next

  • 0

I use KeyPairGenerator class to generate private and public key for RSA algorithm. Next step is to create DigitalSignature for some files. I’m going to use Signature class with public key generated in first step. It is working ok, but I have a problem with getting p and q parameter. How can I get them? I need them to be shown, the same as modulus. When I use .toString() method on private or public key, I can see all these values? Is there any other posibility to get p, q, modulus without parsing this string?

One more thing. Is there any posibility to get only generated key without all this values which are in toString() method?

Thanks a lot!

  • 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-27T13:40:07+00:00Added an answer on May 27, 2026 at 1:40 pm

    You have to cast the result of KeyPair.getPublic() and KeyPair.getPrivate() to RSAPublicKey and RSAPrivateKey.

    EDIT:

    You can cast KeyPair.getPrivate() to RSAPrivateCrtKey to extract P and Q.

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

Sidebar

Related Questions

I have a problem with generating public key for RSA in java. I use
Here are my constants //Encryption fields /** Algorithm=RSA Mode=ECB Padding=PKCS1Padding*/ public static final String
I'm using KeyPairGenerator to generate RSA keypair. Now my other application needs that the
Use case: we have some project meta-data files which we want tracked, but are
I would like to generate private key in java, save it as a 64
Use case: user clicks the link on a webpage - boom! load of files
Use case: I've just entered insert mode, and typed some text. Now I want
use Rack::Static, :urls => ['/stylesheets', '/images'], :root => 'public' run proc { |env| [200,
I want to implement a RSA algorithm to encrypt an image ( byte[] ).
use pthread_create to create limited number of threads running concurrently Successfully compile and run

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.