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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:54:45+00:00 2026-06-04T01:54:45+00:00

I’m trying to build a small certificate authority using bouncycastle. The certificate is generated

  • 0

I’m trying to build a small certificate authority using bouncycastle.

The certificate is generated by using BouncyCastle and is stored in the Certificate Store of the current user, along with the private key.

However for security reasons the key is marked as non-exportable. I know that it is easy to circumvent this, but it’s meant to be an additional barrier.

Now if a new certificate should be signed, I need to access the private key of the certificate. I tried using this code:

X509Certificate2 caCert = GetRootKey(); // Fetches the certificate from the store
AsymmetricCipherKeyPair caPrivKey = DotNetUtilities.GetKeyPair(caCert.PrivateKey);

Unfortunately I get an CryptographicException – because the private key is marked as not exportable, and this is what I intended 😉

My question is: How can I use the private key of the certificate without accessing it? I’m pretty sure I’m missing some important point as it would not make any sense to have a private key stored without any way to access it…

I’m searching now for hours for this, but don’t find anything on stackoverflow or Google.

Can anyone tell me please what I do fundamentally wrong? Is there another approach to sign something?!

Thanks in advance!

Chris

  • 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-04T01:54:47+00:00Added an answer on June 4, 2026 at 1:54 am

    Short answer: Not with BouncyCastle.

    You can’t put the key into the BouncyCastle (or OpenSSL or any other) library and use it from there. There is no way to do this without circumventing the “no export” flag and exporting it, which as you point out is possible if you are an administrator and have the requisite Fu.

    What you can do is get a CryptoAPI handle to the key, and ask CryptoAPI to do the signing or encryption operations for you. The DotNet crypto classes encapsulate CyptoAPI.

    So essentially what you need is a tutorial on how to use the DotNet crypto classes. There are many, for example this MSDN Magazine article has an example of digital signatures about three quarters of the way down:

    http://msdn.microsoft.com/en-us/magazine/cc163454.aspx

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:

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.