Platform SDK: Certificate Enrollment Control

Certificate Enrollment Control Properties in C++

When you set or retrieve a Certificate Enrollment Control property in C++, the method call returns an HRESULT. In this HRESULT, a value of S_OK indicates that the method was successfully executed.

Programs written in C++ can retrieve the Certificate Enrollment Control properties by method calls in the following form:

HRESULT get_propertyName( datatype * pPropValue);

where propertyName specifies the name of the property being accessed, and pPropValue is a pointer to a variable of the appropriate data type. Upon successful completion of this method call, pPropValue will point to the variable containing the value of the propertyName property.

For example, to retrieve the property value for the RootStoreType, you use the following code:

// Get the storetype.
// hr is an HRESULT.
// bstrStoreType is a BSTR variable.
hr = pEnroll->get_RootStoreType( &bstrStoreType );

Programs written in C++ can set the Certificate Enrollment Control properties by calling methods in the form of

HRESULT put_propertyName( datatype PropValue);

where propertyName specifies the name of the property being accessed, and PropValue is a value of the appropriate data type. Upon successful completion of this method call, the new value of the propertyName property will be PropValue.

For example, to set the property value for the RootStoreType, the following code could be used:

// Set the storetype.
// bstrNewType previously set to a valid store type
hr = pEnroll->put_RootStoreType( bstrNewType );