UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:certif.ICertServerPolicy.GetCertificateExtension |
ICertServerPolicy::GetCertificateExtension (certif.h) |
Retrieves a specific certificate extension. |
|
security\icertserverpolicy_getcertificateextension.htm |
security |
e2c8e1d5-6ddb-4c8f-8052-f45cd52e2bef |
12/05/2018 |
CCertServerPolicy object [Security],GetCertificateExtension method, GetCertificateExtension, GetCertificateExtension method [Security], GetCertificateExtension method [Security],CCertServerPolicy object, GetCertificateExtension method [Security],ICertServerPolicy interface, ICertServerPolicy interface [Security],GetCertificateExtension method, ICertServerPolicy.GetCertificateExtension, ICertServerPolicy::GetCertificateExtension, PROPTYPE_BINARY, PROPTYPE_DATE, PROPTYPE_LONG, PROPTYPE_STRING, _certsrv_icertserverpolicy_getcertificateextension, certif/ICertServerPolicy::GetCertificateExtension, security.icertserverpolicy_getcertificateextension |
certif.h |
Certsrv.h |
Windows |
None supported |
Windows Server 2003 [desktop apps only] |
Certidl.lib |
Certcli.dll |
Windows |
19H1 |
|
|
|
|
|
|
The GetCertificateExtension method retrieves a specific certificate extension.
A string that contains the name of the extension.
Specifies the type of the extension. The type can be one of the following values.
A pointer to a VARIANT that receives the requested extension value.
If the method succeeds, the method returns S_OK, and the pvarValue parameter contains the extension value.If the method fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.
The return value is the requested extension value.The SetContext method must be called prior to calling this method. The call to SetContext specifies which request is used as the current context.
Certificate extensions are distinct from certificate properties. Properties are generic data that is attached to the request. Some of these properties are encoded into the certificate (for example: BeginDate), while others are just used to mark requests in the queue and log. Extensions that are not disabled are encoded into the certificate. Extensions are always marked with an object identifier, and always have a critical/noncritical flag.
VARIANT varExt;
HRESULT hr;
VariantInit(&varExt);
// Get the Extension value.
// bstrExtName is BSTR assigned by EnumerateExtensions.
// pCertServerPolicy has been used to call SetContext previously.
hr = pCertServerPolicy->GetCertificateExtension(bstrExtName,
PROPTYPE_BINARY,
&varExt);
if (FAILED(hr))
{
printf("Failed GetCertificateExtension [%x]\n", hr);
goto error;
}
// Successful call; use the value in varExt as needed.
// ...
// When done, clear the Variant
VariantClear(&varExt);