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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:37:39+00:00 2026-06-02T23:37:39+00:00

I need a RSA public key encoded into DER format. The key-pair is generated

  • 0

I need a RSA public key encoded into DER format.

The key-pair is generated using RSACryptoServiceProvider.

What I’m looking for is the c# equivalent to the java:

PublicKey pubKey = myPair.getPublic();
byte[] keyBytes = pubKey.getEncoded();

I have tried looking into BouncyCastle but got lost so if the solution is there any pointers are welcome.

  • 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-06-02T23:37:40+00:00Added an answer on June 2, 2026 at 11:37 pm

    Using Bouncy Castle:

    using Org.BouncyCastle.X509;
    using Org.BouncyCastle.Security;
    using Org.BouncyCastle.Crypto;
    using Org.BouncyCastle.Crypto.Generators;
    using Org.BouncyCastle.Crypto.Parameters;
    
    ...
    
    var generator = new RsaKeyPairGenerator ();
    generator.Init (new KeyGenerationParameters (new SecureRandom (), 1024));
    var keyPair = generator.GenerateKeyPair ();
    RsaKeyParameters keyParam = (RsaKeyParameters)keyPair.Public;
    var info = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo (keyParam);
    RsaBytes = info.GetEncoded ();
    

    The last three lines are the ones who take the RSA public key and export it.

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

Sidebar

Related Questions

I need to extract the RSA public key from a RSA private key using
I've generated an RSA symmetric key pair on a device using SecKeyGeneratePair() on a
I need to send a public key created by RSA by SMS to another
I created a certificate on apache server. x.509 public key certificate RSA created using
I need to implement RSA algorithm in Java. I've found the best solution using
I have a function that generates a BouncyCastle RSA key pair. I need to
I have written a java utility for key pair generation for RSA encryption. But
I'm using C# to generate an RSA public/private key to encrypt user information. I
I have a private key and exponent, i need to implement RSA encryption of
I need a PHP script to decrypt the RSA encrypted string generated by this

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.