Group: Cryptography Reference - Library: crypt32
How to perform Base64 encoding/decoding using Cryptography API Functions
BOOL WINAPI CryptStringToBinary(
LPCTSTR pszString,
DWORD cchString,
DWORD dwFlags,
BYTE* pbBinary,
DWORD* pcbBinary,
DWORD* pdwSkip,
DWORD* pdwFlags
);
DECLARE INTEGER CryptStringToBinary IN crypt32;
STRING @pszString,;
LONG cchString,;
LONG dwFlags,;
STRING @pbBinary,;
LONG @pcbBinary,;
LONG pdwSkip,;
LONG pdwFlags pszString [in] A pointer to a string that contains the formatted string to be converted.
cchString [in] The number of characters of the formatted string to be converted, not including the terminating NULL character. If this parameter is zero, pszString is considered to be a null-terminated string.
dwFlags [in] Indicates the format of the string to be converted.
pbBinary [in] A pointer to a buffer that receives the returned sequence of bytes.
pcbBinary [in, out] A pointer to a DWORD value that, on entry, contains the size, in bytes, of the pbBinary buffer.
pdwSkip [out] A pointer to a DWORD value that receives the number of characters skipped to reach the beginning of the actual base64 or hex strings.
pdwFlags [out] A pointer to a DWORD value that receives the flags actually used in the conversion.
If the function succeeds, the return value is nonzero (TRUE).
Can be used for base64 decoding.
See also: CryptBinaryToString.
Home