Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The StringToVariantByteArray method creates a byte array from a Unicode encoded string. Use this method to create a certificate BLOB from an encoded string that contains a certificate.
Syntax
HRESULT StringToVariantByteArray(
  [in]  BSTR         strEncoded,
  [in]  EncodingType Encoding,
  [out] VARIANT      *pvarByteArray
);
Parameters
[in] strEncoded
A BSTR variable that contains the Unicode encoded string.
[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] pvarByteArray
Pointer to a VARIANT array of bytes. The VARTYPE enumeration value equals VT_ARRAY | VT_UI1.
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 |