Platform SDK: Certificate Enrollment Control |
This method is used to add a certificate template to a request. This method is associated with the Microsoft Certificate Services enterprise Policy Module. This method is an advanced topic and its use is not recommended for most applications.
The phrase 'certificate type' is synonymous with 'certificate template'.
[Visual Basic] objEnroll.addCertTypeToRequest( _ CertType As String ) [C++] HRESULT addCertTypeToRequest( BSTR CertType // in );
[Visual Basic] None.
[C++] The return value is an HRESULT, with S_OK returned if the call is successful.
This method can be called multiple times if more than one certificate template is desired for the request.
BSTR bstrCertType = NULL; HRESULT hr; // allocate BSTR for the certificate template bstrCertType = SysAllocString(L"Machine"); // add the certificate template to the request // pEnroll is previously instantiated ICEnroll2 interface pointer hr = pEnroll->addCertTypeToRequest( bstrCertType ); if ( FAILED( hr ) ) printf("Failed addCertTypeToRequest - %x\n", hr ); else printf("addCertTypeToRequest(%ws) succeeded\n", bstrCertType ); // free BSTR if ( NULL != bstrCertType ) SysFreeString( bstrCertType );
' declare Certificate Enrollment Control object Dim objXen As Object ' variable to contain Cert Template Dim strCertType As String ' instantiate the object Set objXen = CreateObject("CEnroll.CEnroll.1") ' add a cert type to the request strCertType = "Machine" objXen.addCertTypeToRequest strCertType
Windows NT/2000: Requires Windows 2000.
Header: Declared in Xenroll.h.
Library: Use Uuid.lib.