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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:29:44+00:00 2026-05-22T01:29:44+00:00

As we know, a public key consists of a public exponent and a modulus.

  • 0

As we know, a public key consists of a public exponent and a modulus.

My questions is:

How to generate a DER/PEM certificate from public exponent and modulus of RSA?

Thank you very much in advance.

  • 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-22T01:29:44+00:00Added an answer on May 22, 2026 at 1:29 am

    With a public exponent and modulus the best you could hope to do is to get something like this:

    -----BEGIN PUBLIC KEY-----
    MIGGAoGAfHlcdrcuOK6C02rbGR3SgV/ZJ2wnTiFBguh5FHduoB6LcZz49LIC/KcIiH/TckK8GxQd
    oJ7wHCPBpNiumrlC6caj/C8jO/HZ3cb12Wuk4gUuJq1lg5+HTv4KRJ9pFeEFQqS6X+BTztY+EoRx
    uc8MlLXS4PUeouwd9Ios2K0Y5/sCASU=
    -----END PUBLIC KEY-----
    

    That said, usually DER/PEM files are used to hold private keys and you’re not going to be able to get the private exponent when all you have is the public one. If, however, the above is what you’re looking for, let me know and I can post further instructions on how to get it from the modulus / public exponent!

    edit: Here’s how I’d do it:

    <?php
    include('Crypt/RSA.php');
    
    $modulus = new Math_BigInteger($modulusBinaryString, 256);
    $exponent = new Math_BigInteger($exponentBinaryString, 256);
    
    $rsa = new Crypt_RSA();
    $rsa->modulus = $modulus;
    $rsa->exponent = $exponent;
    $rsa->publicExponent = $exponent;
    $rsa->k = strlen($rsa->modulus->toBytes());
    
    echo $rsa->getPublicKey(CRYPT_RSA_PRIVATE_FORMAT_PKCS1);
    ?>
    

    I’m using phpseclib, a pure PHP RSA implementation.

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

Sidebar

Related Questions

Do you know of a tutorial that demonstrates Public Private Key encryption(PPKE) in C++
Does anyone know a C# framework that can generate public/private keys, X.509 certificates and
As we all know Java program will start executing from the public static void
So I know how to encode/decode a public key in the BouncyCastle C# library
I am trying to export a public key from openssl using python. I have
I need to know what is public key infastructure. I need to know is
A digital certificate is a digital document that certifies that a certain public key
I am developing an android application that uses a public key certificate to sign
I've read the parts of RFC 2459 (Internet X.509 Public Key Infrastructure Certificate and
I know that RSACryptoServiceProvider can encrypt with the public key, then it can be

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.