Using the Included Samples

The Certificate Enrollment API includes multiple samples designed to help you create custom applications. Most of the samples are written by using C++, but C# and Visual Basic Scripting Edition (VBScript) samples are also included.

When you install the Microsoft Windows Software Development Kit (SDK), the following samples are installed, by default, in the %ProgramFiles%\Microsoft SDKs\Windows\v7.0\Samples\Security\X509 Certificate Enrollment\ folder.

Sample Description Language
createCNGCustomCMC Creates a CMC request object from an inner nested PKCS #10 request.
C++
enrollCommon Contains the following helper functions and macros used by the included samples.
C++
enrollCustomCMC Creates a CMC certificate request and enrolls a computer in a certificate hierarchy.
C++
enrollCustomPKCS10 Creates a custom PKCS #10 request, submits it to a stand-alone certification authority (CA), and installs the issued certificate in the certificate store.
C++
enrollCustomPKCS10_2 Creates a custom PKCS #10 request and attempts to enroll it in an enterprise CA.
C++
enrollEOBOCMC Creates a CMC certificate request on behalf of another user and enrolls the user in a certificate hierarchy.
C++
enrollFromPublicKey Initializes a PKCS #10 certificate request object, wraps it in a CMC request object, submits the CMC request to an enterprise CA, and saves the certificate returned by the CA in a file.
C++
enrollKeyArchivalCMC Creates a CMC certificate request to archive a private key on a CA.
C++
enrollNestedCMC Reads an existing CMC certificate request from a file, wraps it in another CMC request, signs this outer request, submits it to a CA, and saves the certificate response from the CA to a file.
C++
enrollPKCS7 Creates a PKCS #7 request from an existing certificate by inheriting the public and private keys and the certificate template. The sample enrolls the user in a certificate hierarchy and installs the certificate response.
C++
enrollRenewalPKCS7 Creates a PKCS #7 request object to renew an existing certificate.
C++
enrollSimpleMachineCert Enrolls a computer in a certificate hierarchy by using a template, a certificate display name, and the certificate description.
C++, VBS
enrollSimpleUserCert Enrolls an end user with a CA by using a template, the subject name, and the length, in bits, of the key.
C++, C#
enrollWithIX509EnrollmentHelper Demonstrates how to use the Windows 7 HTTP protocol to enroll a certificate in an enterprise CA.
C#
installResponseFromPFX Installs an enrolled certificate from a Personal Information Exchange (PFX) file to the certificate store.
C++

Using the Certificate Enrollment API