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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:48:10+00:00 2026-05-18T02:48:10+00:00

How to convert pkcs8 key file to DER format, to get Private and Public

  • 0

How to convert pkcs8 key file to DER format, to get Private and Public key in Xml format?

with openssl I can do it using:
openssl pkcs8 -inform DER -in aaa010101aaa_FIEL.key -out aaa.txt

aaa010101aaa_FIEL.key is bynary file

I’m trying to do it with Bouncy Castle library but I have problems to create new EncryptedPrivateKeyInfo(…

there is a post to do that in java, but i need it in c#
How to read a password encrypted key with java?

  • 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-18T02:48:11+00:00Added an answer on May 18, 2026 at 2:48 am

    I found the Answer!

                byte[] dataKey = File.ReadAllBytes(fileName);
    
            Org.BouncyCastle.Crypto.AsymmetricKeyParameter asp =
                Org.BouncyCastle.Security.PrivateKeyFactory.DecryptKey(pass.ToCharArray(), dataKey);
    
            MemoryStream ms = new MemoryStream();
            TextWriter writer = new StreamWriter(ms);
            System.IO.StringWriter stWrite = new System.IO.StringWriter();
            Org.BouncyCastle.OpenSsl.PemWriter pmw = new PemWriter(stWrite);
            pmw.WriteObject(asp);
            stWrite.Close();
            return stWrite.ToString();
    

    How to Load pkcs8 binary file format key

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

Sidebar

Related Questions

I used openSSL command to create 2 files: 1 for RSA public key &
I need to convert certificate from DER format to pkcs#12 format. I know I
I need to convert the following format into a new format using NSDateFormatter. 'Fri,
Hello everyone I'm trying to convert a PKCS#8 private key that I generate in
From OpenSSL 1.0 change log: Make PKCS#8 the default write format for private keys,
convert this: $300 to this : 300 can't do it with intval() or (int)
AIM : Convert a resultset to XML and assign the result to a variable
To convert a date from string to Unix time, I can use date --date
I want convert GMT time to EST time and get a timestamp. I tried
I convert video from different formats to flv using xuggle MediaTool. For most of

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.