Skip to content

Latest commit

 

History

History
127 lines (106 loc) · 4.23 KB

nf-certenroll-ix500distinguishedname-encode.md

File metadata and controls

127 lines (106 loc) · 4.23 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:certenroll.IX500DistinguishedName.Encode
IX500DistinguishedName::Encode (certenroll.h)
Initializes the object from a string that contains a distinguished name.
Encode
Encode method [Security]
Encode method [Security]
IX500DistinguishedName interface
IX500DistinguishedName interface [Security]
Encode method
IX500DistinguishedName.Encode
IX500DistinguishedName::Encode
certenroll/IX500DistinguishedName::Encode
security.ix500distinguishedname_encode_method
security\ix500distinguishedname_encode_method.htm
security
da0d4479-dc58-4719-886e-5ce610764305
12/05/2018
Encode, Encode method [Security], Encode method [Security],IX500DistinguishedName interface, IX500DistinguishedName interface [Security],Encode method, IX500DistinguishedName.Encode, IX500DistinguishedName::Encode, certenroll/IX500DistinguishedName::Encode, security.ix500distinguishedname_encode_method
certenroll.h
Windows
Windows Vista [desktop apps only]
Windows Server 2008 [desktop apps only]
CertEnroll.dll
Windows
19H1
IX500DistinguishedName::Encode
certenroll/IX500DistinguishedName::Encode
c++
APIRef
kbSyntax
COM
CertEnroll.dll
IX500DistinguishedName.Encode

IX500DistinguishedName::Encode

-description

The Encode method initializes the object from a string that contains a distinguished name. This method is web enabled.

-parameters

-param strName [in]

A BSTR variable that contains the string to encode.

-param NameFlags [in]

An X500NameFlags enumeration value that specifies the format of the encoded value.

Note  The following flags are set automatically:
  • The default value specified in Certenroll.h is XCN_CERT_NAME_STR_NONE.
  • If you do not specify XCN_CERT_NAME_STR_FORWARD_FLAG, then XCN_CERT_NAME_STR_REVERSE_FLAG is automatically applied.
  • If you do not specify XCN_CERT_NAME_STR_DISABLE_UTF8_DIR_STR_FLAG, then XCN_CERT_NAME_STR_FORCE_UTF8_DIR_STR_FLAG is automatically applied.
  • XCN_CERT_NAME_STR_ENABLE_PUNYCODE_FLAG is automatically set regardless of any other flag you specify.
 

-returns

If the function succeeds, the function returns S_OK.

If the function fails, it returns an HRESULT value that indicates the error. Possible values include, but are not limited to, those in the following table. For a list of common error codes, see Common HRESULT Values.

Return code/value Description
E_OUTOFMEMORY
Memory could not be allocated for the encoded value.
E_POINTER
The strName parameter cannot be NULL.
HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE)
The length, in characters of the strName parameter cannot exceed 64 * 1024.

-remarks

This method internally calls the CryptoAPI CertStrToName function. Call the Name property to retrieve the name as a null-terminated character string. Call the EncodedName property to retrieve a string containing an encoded name.

-see-also

IX500DistinguishedName