login about faq

I am assigned the task of creating a sample ASP.NET Core application that will read an X509 certificate from a smart card. How do I do that?

I am used to performing these function from Active Directory, so I have no idea..

asked May 09 '17 at 16:30

chilkat's gravatar image

chilkat ♦♦

A smart card protects the private key. There is no need to protect the certificate itself. The purpose of the smart card is for the protection of the private key that is associated with the certificate. An X509 certificate contains the public part of the key within it's contents.

So.. what you want to do is install the certificate on the Windows computer/server were your ASP.NET Core application will be running. The smart card vendor probably provided something files w/ or without instructions on how to do it. Once you've installed the cert on the computer, you should be able to see it in the Microsoft Certificate Management console. Go to the Windows Start menu, click on "Run.." and then type "certmgr.msc". Look in the Certificates -- Current User / Personal / Certificates.

Once installed there, you can use it (and the private key on the smart card) just like you would use any certificate. For example, see https://www.example-code.com/csharp/crypt_create_p7m_using_installed_cert.asp

Chilkat will automatically see that the private key is non-exportable, and will defer to the Microsoft Crypto-API to do the work. It will automatically use the smart card for PKI operations (signing, decrypting, etc.) However, you may be limited to whatever functionality/algorithms are supported by the vendor's CSP. If you need to do something it doesn't support, then you're out of luck.


answered May 09 '17 at 16:41

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: May 09 '17 at 16:30

Seen: 3,159 times

Last updated: May 09 '17 at 16:41

powered by OSQA