以下是 ICertServerPolicy 接口的定义:
// Certif.h 头文件中的声明
#pragma once
#include <windows.h>
#include <certsrv.h>
// ICertServerPolicy 接口的定义
class ICertServerPolicy : public IUnknown {
public:
virtual HRESULT STDMETHODCALLTYPE Initialize(
/* [in] */ __RPC__in const BSTR strConfig,
/* [in] */ __RPC__in const BSTR strPolicy,
/* [in] */ LONG RequestId,
/* [in] */ LONG Flags,
/* [in] */ LONG Context,
/* [retval][out] */ __RPC__out HRESULT *phrRequest) = 0;
virtual HRESULT STDMETHODCALLTYPE GetRequestAttributes(
/* [retval][out] */ __RPC__deref_out_opt BSTR *pstrAttributes) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCertificateProperty(
/* [in] */ __RPC__in const BSTR strPropertyName,
/* [in] */ LONG PropertyType,
/* [retval][out] */ __RPC__out VARIANT *pvarPropertyValue) = 0;
virtual HRESULT STDMETHODCALLTYPE SetCertificateProperty(
/* [in] */ __RPC__in const BSTR strPropertyName,
/* [in] */ LONG PropertyType,
/* [in] */ __RPC__in VARIANT *pvarPropertyValue) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCertificateExtension(
/* [in] */ __RPC__in const BSTR strExtensionName,
/* [in] */ LONG Type,
/* [retval][out] */ __RPC__out VARIANT *pvarValue) = 0;
virtual HRESULT STDMETHODCALLTYPE SetCertificateExtension(
/* [in] */ __RPC__in const BSTR strExtensionName,
/* [in] */ LONG Type,
/* [in] */ LONG Flags,
/* [in] */ __RPC__in VARIANT *pvarValue) = 0;
virtual HRESULT STDMETHODCALLTYPE EnumerateExtensionsSetup(
/* [in] */ LONG Flags) = 0;
virtual HRESULT STDMETHODCALLTYPE EnumerateExtensions(
/* [retval][out] */ __RPC__out VARIANT *pvarExtensions) = 0;
virtual HRESULT STDMETHODCALLTYPE EnumerateExtensionsClose() = 0;
virtual HRESULT STDMETHODCALLTYPE EnumerateAttributesSetup(
/* [in] */ LONG Flags) = 0;
virtual HRESULT STDMETHODCALLTYPE EnumerateAttributes(
/* [retval][out] */ __RPC__out VARIANT *pvarAttributes) = 0;
virtual HRESULT STDMETHODCALLTYPE EnumerateAttributesClose() = 0;
virtual HRESULT STDMETHODCALLTYPE GetRequestId(
/* [retval][out] */ __RPC__out LONG *pRequestId) = 0;
virtual HRESULT STDMETHODCALLTYPE GetRequestSubmitCert(
/* [retval][out] */ __RPC__deref_out_opt BSTR *pstrCert) = 0;
virtual HRESULT STDMETHODCALLTYPE GetRequestRawArchivedKey(
/* [retval][out] */ __RPC__deref_out_opt BSTR *pstrArchivedKey) = 0;
virtual HRESULT STDMETHODCALLTYPE GetRequestKeyContainerName(
/* [retval][out] */ __RPC__deref_out_opt BSTR *pstrContainer) = 0;
virtual HRESULT STDMETHODCALLTYPE SetCertificateContext(
/* [in] */ __RPC__in PCCERT_CONTEXT pCert) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCertificateContext(
/* [retval][out] */ __RPC__deref_out_opt PCCERT_CONTEXT *ppCert) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCertificateDescription(
/* [in] */ LONG Type,
/* [retval][out] */ __RPC__deref_out_opt BSTR *pstrDescription) = 0;
virtual HRESULT STDMETHODCALLTYPE FinalizeRequest(
/* [in] */ LONG Flags,
/* [retval][out] */ __RPC__out HRESULT *phrDisposition) = 0;
virtual HRESULT STDMETHODCALLTYPE GetRequestIdString(
/* [retval][out] */ __RPC__deref_out_opt BSTR *pstrRequestId) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCertificatePropertyFlags(
/* [in] */ __RPC__in const BSTR strPropertyName,
/* [retval][out] */ __RPC__out LONG *pFlags) = 0;
};
这个接口包括多个方法,允许实现者控制证书颁发策略的不同方面,例如获取请求属性、设置证书扩展、设置证书属性、最终确定证书颁发结果等。通过实现这个接口,你可以自定义证书颁发过程,以适应你的特定需求。
转载请注明出处:http://www.zyzy.cn/article/detail/24247/Win32 API/Certif.h/ICertServerPolicy