7

I have a USB token containing an encryption certificate which has a public key and private key. Now I want to create an application in C# through which I can find out the accessible certificate information. When I plug the USB token in, it is being detected, but no drive has been shown on the computers segment as it happens with the flash drives.

How can I read the certificate from the USB drive?

Jon Crowell
  • 21,695
  • 14
  • 89
  • 110
habibalsaki
  • 1,082
  • 4
  • 13
  • 25
  • 1
    This answer might be of interest: http://stackoverflow.com/a/8424686/1373170 – Pablo Romeo Sep 16 '12 at 06:18
  • thanks Pablo... I am looking for something more specific... still this provides me some good information – habibalsaki Sep 16 '12 at 07:05
  • No prob. Also you may want to look for a vendor specific api for the device you have, or expand your question with more specific details on the device and what you'd want to get and I'm sure somebody will be able to help you out ;) – Pablo Romeo Sep 16 '12 at 14:30
  • In case of web application, refer to answer https://stackoverflow.com/a/63173083/9659885 – Bharat Vasant Aug 02 '22 at 12:09

1 Answers1

6

You can browse through a list of certificates with X509Store class. It will give you not only the certification in you USB, but also in your computer. Then with X509Certificate2UI you can select the right certificate from a graphical UI list.

This implementation example works fine to get started: http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509certificate2ui(v=vs.110).aspx