enrollKeyArchivalCMC
The enrollKeyArchivalCMC sample creates a CMC certificate request to archive a private key on a certification authority (CA). For more information, see CMC Key Archival Request.
Location
When you install the Microsoft Windows Software Development Kit (SDK), the sample is installed, by default, in the %ProgramFiles%\Microsoft SDKs\Windows\v7.0\Samples\Security\X509 Certificate Enrollment\VC\enrollKeyArchivalCMC folder.
Discussion
The enrollKeyArchivalCMC sample:
- Processes the command line arguments. The command line should contain the name of the certificate template to use for enrollment.
- Creates an IX509CertificateRequestCmc certificate request object and initializes it for an end-user context by using the template name.
- Sets the ArchivePrivateKey property on the CMC request.
- Creates an ICertConfig object and uses it to retrieve a string that contains the CA configuration.
- Creates a CryptoAPI ICertRequest2 object and uses it to retrieve the exchange certificate for the CA.
- Creates an IX509Enrollment object, initializes it by using the CMC request, creates a base64 encoded string that contains the key archival request, and submits it to the CA.
Related topics