IBinaryConverter::VariantByteArrayToString method (certenroll.h)

The VariantByteArrayToString method creates a Unicode encoded string from a byte array. You can use this method to create a printable string from a certificate BLOB.

Syntax

HRESULT VariantByteArrayToString(
  [in]  VARIANT      *pvarByteArray,
  [in]  EncodingType Encoding,
  [out] BSTR         *pstrEncoded
);

Parameters

[in] pvarByteArray

Pointer to a VARIANT array of bytes to be encoded. Each byte in the array must be an unsigned integer. That is, the VARTYPE enumeration value must equal VT_ARRAY | VT_UI1.

[in] Encoding

An EncodingType enumeration value that specifies the Unicode encoding applied to the input string. The default value is XCN_CRYPT_STRING_BASE64.

[out] pstrEncoded

Pointer to a BSTR variable that contains the Unicode-encoded certificate.

Return value

If the function succeeds, the function returns S_OK.

If the function fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header certenroll.h
DLL CertEnroll.dll

See also

IBinaryConverter