InitUser Sample: Initialize Client

Click to open or copy the files for the InitUser sample.

The Inituser sample sets up the default cryptographic client. This sample (or its equivalent) must be run prior to running the other cryptography samples, so that they will work correctly.

Inituser performs the following operations:

These operations only need to be done once, unless the operating system is reinstalled. If the default key container and key pairs have already been created, this sample performs no operations.

Building SDK Samples

This sample uses the following keywords:

cryptacquirecontext; cryptdestroykey; cryptgenkey; cryptgetprovparam; cryptgetuserkey; cryptreleasecontext; exit; getlasterror; printf