Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Window C/C++ Crypto API Examples and tips

I'm asking this question because I've spent the best part of a day trawling through msdn docs and other opaque sources for simple straightforward guidelines on how to get started with the Windows C/C++ Crypto API.

What I'd like to see is some example code, typical include paths, linking guidelines, etc, anything useful really. I know this is an imprecise question but I reckon imprecise answers are better none at all.

I'll get the ball rolling with my own meager findings...

like image 331
Gearoid Murphy Avatar asked Jan 25 '11 17:01

Gearoid Murphy


People also ask

How to use Crypto API in c++?

You must link to the cryptography libraries explicitly. Assuming you're in Visual Studio, you can add the reference by right clicking on the C++ project, choosing properties, and selecting Configuration Properties -> Linker on the treeview at left. You can then specify crypt32. lib in the input field on the right.

What is Crypto API?

What is CryptoAPI? CryptoAPI is a core component of the latest versions of Microsoft Windows that provides application programming interfaces (APIs) for cryptographic security services that provide secure channels and code signing for communication between applications. CryptoAPI.


1 Answers

Here's a bunch of examples I've found....

  • Example C Program: Listing the Certificates in a Store
  • Example C Program: Using CryptAcquireContext
  • Example C Program: Enumerating CSP Providers and Provider Types
  • Example C Code for Opening Certificate Stores
  • Example C Program: Sending and Receiving a Signed and Encrypted Message
  • Example C Program: Signing a Hash and Verifying the Hash Signature

MSDN has these examples scattered around the docs

This website provides a good overview of the concepts along with cross-platform examples

like image 159
Gearoid Murphy Avatar answered Sep 17 '22 10:09

Gearoid Murphy