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

  • Home
  • SEARCH
  • 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 107781
In Process

The Archive Base Latest Questions

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

My company has a web document management application and I have been assigned to

  • 0

My company has a web document management application and I have been assigned to find a way to sign pdf files with the user digital certificate.

The pdfs can go from a few kb to over 100Mb, this is over the internet so the signature must take place at the web server.

In order to do this i have built an activeX control that asks the user to choose the certificate, then uploads it to a webpage using WebClient.UploadData sending the certificate as a byte array.

On the web page when i’m trying to sign the pdf document i am getting an error ‘Key does not exist’. This comes to no surprise to me because when i was using the certificate directly over an https connection after i choose the proper certificate i would be prompt for the key. This is not happening with the activeX.

This is how i’m getting the certificate from the user:

private static X509Certificate2 PickCertificate()         {             X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);             try             {                 store.Open(OpenFlags.ReadOnly);                  // pick a certificate from the store                 X509Certificate2 cert = X509Certificate2UI.SelectFromCollection(store.Certificates, 'Title', 'Message', X509SelectionFlag.SingleSelection)[0];                  // show certificate details dialog                 X509Certificate2UI.DisplayCertificate(cert);                 store.Close();                 return cert;             }             finally { store.Close(); }         } 

How can I ask the user to provide the key i am missing?

  • 1 1 Answer
  • 2 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. 2026-05-11T01:48:30+00:00Added an answer on May 11, 2026 at 1:48 am

    You want the user to upload their certificate’s private key to the webserver so that it may sign PDFs? If so, that’s fundamentally broken from a security perspective.

    I think you may have missed the point that public certificate != private key. (Most of us are sloppy and use the word ‘certificate’ to refer to either (or both) of those things, so that’s not entirely suprising). Going from memory, the CryptoAPI only has a select set of methods that will allow you to access the key. There must be an ‘export as PFX’ method amongst those, so you could make your design work if you really, really wanted to, but there’s no way I’d recommend this. (Risk of sending private keys to webserver, broken non-repudiation, etc etc).

    If you really must do the signing on the server [I don’t really understand your argument, signature should not add much data to the upload], then you should probably consider a multi-tiered architecture, and a key escrow mechanism. This way you can at least minimize some of the security concerns (but you’ll still lose non-repudiation… and introduce other risks. No free lunch here).

    So… you probably need to consider re-architecting your application so that PDF signature occurs on the client (in your ActiveX control), before the PDF file is uploaded. I imagine you will need a 3rd-party library for the signature step as discussed in this SO thread.

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

Sidebar

Related Questions

I have a web application from a company that has gone out of business.
We have a web application that has been built using MySQL / PHP /
My company has a web application built in ASP.NET and they have asked me
the company I work for has a web-based user interface which paying clients log
I've been working on a web application for a company that assists them with
Our company has a multi tenant asp.net web application. The application is 3 tier
My web hosting company has upgraded PHP to version 5.4.7. I have no choice
My company has a web application hosted on a client's machine that uses forms
Our company has a fairly large ASP.NET web application. The app is already broken
Our company has a web service which I want to send XML files (stored

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.