Free Support Forum -

Digitally Sign PDF from USB eToken


Is it possible to sign PDF document retrieving the private key from USB token?
The examples available using the PdfSignDigitalOptions class gets the private key from a pfx file.



Thank you for your inquiry. From your request, it’s not clear that you are trying to explore GroupDocs.Signature product for which platform (.NET, Java or Cloud)?. Please specify the details and we will be glad to help you.


Thanks for your reply. My request is for the .Net platform, specifically in C #.

Basically, we need to sign with a certificate that we retrieve from the certificate store on the user computer.
This certificate is associated with an RSACryptoServiceProvider (USB token) that holds the Private Key.

Code we use to retrieve the certificate:

X509Certificate2 x509;
X509Store store = new X509Store(StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
X509Certificate2Collection collection = (X509Certificate2Collection)store.Certificates;
X509Certificate2Collection fcollection = (X509Certificate2Collection)collection.Find(X509FindType.FindBySubjectName, "CertSubjectName", false);
X509Certificate2Collection scollection = X509Certificate2UI.SelectFromCollection(fcollection, "Test Certificate Select", "Select a certificate from the following list to get information on that certificate", X509SelectionFlag.SingleSelection);
if(scollection.Count > 0)
    x509 = scollection[0];

Hope the details help!



We are investigating this scenario at our end. Your investigation ticket ID is SIGNATURENET-1746. As we have any further updates on it, we’ll notify you.



We have an update for you regarding SIGNATURENET-1746. Please note that GroupDocs.Signature for .NET API digitally signs the documents only based PFX certificate files (that keeps private and public keys).
Secondly, the extract functionality is not related to our API. It means that API only supports document manipulation (documents signing) rather than extracting digital certificates from different sources.