Skip to content

Commit

Permalink
Reformat Example-to-use-OpenSC-with-Microsoft-CNG-and-CryptoAPI.md
Browse files Browse the repository at this point in the history
  • Loading branch information
xhanulik committed May 3, 2024
1 parent 5c19324 commit c8d929a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Example-to-use-OpenSC-with-Microsoft-CNG-and-CryptoAPI.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# OpenSC and Microsoft CNG

It is possible to use the Smartcard via OpenSC with the [Microsoft CNG](https://msdn.microsoft.com/de-de/library/windows/desktop/aa376210(v=vs.85).aspx) library. CNG can be used together with [CryptoAPI](https://msdn.microsoft.com/en-us/library/ms867086.aspx).

## Example: Read the x509 Certificate from connected Smartcard

With the CNG its easy to use the smartcard like a normal pkcs12 container or something similar.

```
```C
#include <Windows.h>
#include <wincrypt.h>

Expand Down Expand Up @@ -78,7 +80,8 @@ int main() {
```

### Important functions

* [NCryptOpenStorageProvider](https://msdn.microsoft.com/de-de/library/windows/desktop/aa376286(v=vs.85).aspx)
* [NCryptEnumKeys](https://msdn.microsoft.com/en-us/library/windows/desktop/aa376259(v=vs.85).aspx)
* [NCryptOpenKey](https://msdn.microsoft.com/de-de/library/windows/desktop/aa376284(v=vs.85).aspx)
* [NCryptGetProperty](https://msdn.microsoft.com/de-de/library/windows/desktop/aa376273(v=vs.85).aspx)
* [NCryptGetProperty](https://msdn.microsoft.com/de-de/library/windows/desktop/aa376273(v=vs.85).aspx)

0 comments on commit c8d929a

Please sign in to comment.