Skip to content

Latest commit

 

History

History
172 lines (134 loc) · 5.77 KB

nf-certif-icertserverpolicy-getcertificateextension.md

File metadata and controls

172 lines (134 loc) · 5.77 KB
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.
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
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
ICertServerPolicy::GetCertificateExtension
certif/ICertServerPolicy::GetCertificateExtension
c++
APIRef
kbSyntax
COM
Certcli.dll
ICertServerPolicy.GetCertificateExtension
CCertServerPolicy.GetCertificateExtension

ICertServerPolicy::GetCertificateExtension

-description

The GetCertificateExtension method retrieves a specific certificate extension.

-parameters

-param strExtensionName [in]

A string that contains the name of the extension.

-param Type [in]

Specifies the type of the extension. The type can be one of the following values.

Value Meaning
PROPTYPE_LONG
Signed long data
PROPTYPE_DATE
Date/time
PROPTYPE_BINARY
The extension value is retrieved as is and is ASN.1 encoded if necessary.
PROPTYPE_STRING
The extension value is ASN.1 encoded as an IA5 string.

-param pvarValue [out]

A pointer to a VARIANT that receives the requested extension value.

-returns

C++

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.

VB

The return value is the requested extension value.

-remarks

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.

Examples

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);

-see-also

ICertServerPolicy

ICertServerPolicy::GetCertificateExtensionFlags

ICertServerPolicy::SetContext