Skip to content

Latest commit

 

History

History
308 lines (259 loc) · 9.65 KB

nf-certcli-icertconfig-getfield.md

File metadata and controls

308 lines (259 loc) · 9.65 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:certcli.ICertConfig.GetField
ICertConfig::GetField (certcli.h)
Gets a specific field from the current record of the configuration database. This method was first defined in the ICertConfig interface.
Authority
CCertConfig object [Security]
GetField method
CommonName
Config
Country
Description
ExchangeCertificate
Flags
GetField
GetField method [Security]
GetField method [Security]
CCertConfig object
GetField method [Security]
ICertConfig interface
GetField method [Security]
ICertConfig2 interface
ICertConfig interface [Security]
GetField method
ICertConfig.GetField
ICertConfig2 interface [Security]
GetField method
ICertConfig2::GetField
ICertConfig::GetField
Locality
OrgUnit
Organization
SanitizedName
SanitizedShortName
Server
ShortName
SignatureCertificate
State
WebEnrollmentServers
_certsrv_icertconfig_getfield
certcli/ICertConfig2::GetField
certcli/ICertConfig::GetField
security.icertconfig2_getfield
security\icertconfig2_getfield.htm
security
8e477fa7-d0e7-43f3-98b5-79c924a1a29c
12/05/2018
Authority, CCertConfig object [Security],GetField method, CommonName, Config, Country, Description, ExchangeCertificate, Flags, GetField, GetField method [Security], GetField method [Security],CCertConfig object, GetField method [Security],ICertConfig interface, GetField method [Security],ICertConfig2 interface, ICertConfig interface [Security],GetField method, ICertConfig.GetField, ICertConfig2 interface [Security],GetField method, ICertConfig2::GetField, ICertConfig::GetField, Locality, OrgUnit, Organization, SanitizedName, SanitizedShortName, Server, ShortName, SignatureCertificate, State, WebEnrollmentServers, _certsrv_icertconfig_getfield, certcli/ICertConfig2::GetField, certcli/ICertConfig::GetField, security.icertconfig2_getfield
certcli.h
Certsrv.h
Windows
None supported
Windows Server 2003 [desktop apps only]
Certidl.lib
Certcli.dll
Windows
19H1
ICertConfig::GetField
certcli/ICertConfig::GetField
c++
APIRef
kbSyntax
COM
Certcli.dll
ICertConfig2.GetField
ICertConfig.GetField
CCertConfig.GetField

ICertConfig::GetField

-description

The GetField method gets a specific field from the current record of the configuration database. This method was first defined in the ICertConfig interface.

-parameters

-param strFieldName [in]

Specifies the name of the field to return. This parameter can be one of the following valid strings for field names (note that some certification authorities may not provide data for each field).

Value Meaning
Authority
Reference certification authority (CA) name.
CommonName
Common name of the server.
Config
Reference computer\CA name.
Country
Country/region.
Description
Descriptive comment about the server (replaces obsolete "Comment").
ExchangeCertificate
Name of the file that contains the exchange certificate (applies to Certificate Services 1.0 only).
Flags
String that represents the location where the CA information was found. For more information, see Remarks.
Locality
City or town.
Organization
Organization.
OrgUnit
Organizational unit.
SanitizedName
CA name that is sanitized according to the rules described in GetConfig.
SanitizedShortName
CA name that is sanitized and shortened according to the rules described in GetConfig.
Server
Reference computer name.
ShortName
SanitizedShortName, but with the '!xxx' sequences, as described in GetConfig, translated back into the original text.
SignatureCertificate
Name of the file that contains the CA certificate (also known as the CA signature certificate); this may or may not be a root certificate.
State
State or province.
WebEnrollmentServers
An array of certificate enrollment Web service URLs for a specific CA configuration in the Active Directory.

Windows Vista and Windows Storage Server 2003:  This field is not supported.

-param pstrOut [out, retval]

A pointer to a BSTR that receives the data from the field. When you have finished using the BSTR, free pbstrOut by calling the SysFreeString function.

-returns

C++

If the method succeeds, the method returns S_OK.

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 a string that represents the data for the field.

-remarks

This method returns the field data for the specified field.

When you specify "Flags" in the strFieldName parameter, the retrieved data for the flags field is a string that can be converted to an integer by means of the C-library function _wtoi. The resulting integer represents a bitfield that can be examined to determine whether the flags CAIF_DSENTRY and CAIF_SHAREDFOLDERENTRY are set. If CAIF_DSENTRY (0x00000001) is set, the information for the CA was contained in Directory Services. If CAIF_SHAREDFOLDERENTRY (0x00000002) is set, the information for the CA was contained in the shared folder. Note that one or both of these flags may be set.

Examples

    BSTR  bstrFieldName = NULL;
    BSTR  bstrFieldValue = NULL;
    HRESULT    hr;

    // Specify the field to retrieve, for example, "CommonName".
    bstrFieldName = SysAllocString(L"<FIELDNAMEHERE>");
    if (NULL == bstrFieldName)
    {
        printf("Memory allocation failed for bstrFieldName.\n");
        goto error;
    }

    // pConfig is a previously instantiated ICertConfig object.
    hr = pConfig->GetField(bstrFieldName, &bstrFieldValue);
    if (FAILED(hr))
    {
        printf("Failed GetField - [%x]\n", hr);
        goto error;
    }
    else
        printf("GetField value for %ws is: %ws\n", 
            bstrFieldName, bstrFieldValue );

error:

    if (bstrFieldName)
        SysFreeString(bstrFieldName);

    if (bstrFieldValue)
        SysFreeString(bstrFieldValue);

-see-also

CCertConfig

ICertConfig