The ICertPolicy2 interface is one of two interfaces that provide communications between the Certificate Services server engine and the policy module.
Note The policy module can communicate with the Certificate Services server engine by using the ICertServerPolicy interface.
The Certificate Services server engine calls the ICertPolicy2 methods to perform the following tasks:
- Initialize the policy module.
- Notify the policy module that a new request has entered the system. The policy module can then use the methods of the ICertServerPolicy interface to indicate that the request is good and should be issued, is bad and should be denied, or should be held for later consideration.
- Retrieve a description of the policy module and its functionality.
- Notify the policy module that the Certificate Services server is being terminated.
Certificate Services interfaces support both apartment-threading and free-threading models. For better throughput, free threading is recommended.
The ICertPolicy2 interface inherits and extends the ICertPolicy interface.
The ICertPolicy2 interface has these methods.
Returns a human-readable description of the policy module and its function.(Inherited from ICertPolicyCCertPolicy)
Retrieves the ICertManageModule interface implemented by the policy module.(Inherited from ICertPolicy2ICertPolicyCCertPolicy)
Called by the server engine to allow the policy module to perform initialization tasks.(Inherited from ICertPolicyCCertPolicy)
Called by the server engine before the server is terminated.(Inherited from ICertPolicyCCertPolicy)
Notifies the policy module that a new request has entered the system.(Inherited from ICertPolicyCCertPolicy)
Implementers of ICertPolicy should also implement ICertManageModule. Additionally, the ProgID for a class implementing ICertPolicy must conform to a naming convention. Specifically, the ProgID must be of the form:
Where MyApp is a specifier that identifies the application. For example, in C++, the following could be used in the DECLARE_REGISTRY macro of a class (CMyCertPolicyModule) which implements ICertPolicy.
DECLARE_REGISTRY( CMyCertPolicyModule, L"MyCode.Policy.1", L"MyCode.Policy", IDS_CERTPOLICYMODULE_DESC, THREADFLAGS_BOTH);
For the previous example, the IDS_CERTPOLICYMODULE_DESC value is an application-specific identifier in the resource file (.rc) for a string which describes the class.
String constants defined in Certmod.h can be used to simplify following the naming convention.
No more than one Visual Basic Scripting Edition policy module may be registered on the Certificate Services server at one time. If more than one such policy module is registered on the Certificate Services server, the Certification Authority MMC snap-in, Certificate Services application, or Certutil tool may produce errors. Note that the Visual Basic Scripting Edition development environment automatically registers a DLL when it is successfully built. As a result, you may encounter this situation when one Visual Basic Scripting Edition policy module is already registered and another Visual Basic Scripting Edition policy module is created. To avoid this situation, you must unregister one of the Visual Basic Scripting Edition policy modules, by using the command-line instruction regsvr32 /u FileName.dll, where FileName.dll is the name of the Visual Basic Scripting Edition policy module that you do not intend to make active.
Implementers of ICertPolicy in Visual Basic Scripting Edition must name their project in the form:
Where MyApp is a specifier that identifies the application; further, the class implementing ICertPolicy must be named "Policy".
Minimum supported client
|None supported [desktop apps only]|
Minimum supported server
|Windows Server 2003 [desktop apps only]|
IID_ICertPolicy2 is defined as 3db4910e-8001-4bf1-aa1b-f43a808317a0
Build date: 10/26/2012