DRMEncode function (msdrm.h)
[The AD RMS SDK leveraging functionality exposed by
the client in Msdrm.dll is available for use in Windows Server 2008, Windows Vista, Windows Server 2008 R2, Windows 7, Windows Server 2012, and Windows 8. It may be altered or
unavailable in subsequent versions. Instead, use Active Directory Rights Management Services SDK 2.1,
which leverages functionality exposed by the client in Msipc.dll.]
The DRMEncode function encodes data using a public encoding method, such as base64.
Syntax
DRMEXPORT HRESULT UDAPICALL DRMEncode(
[in] PWSTR wszAlgID,
[in] UINT uDataLen,
[in] BYTE *pbDecodedData,
[in, out] UINT *puEncodedStringLen,
[out] PWSTR wszEncodedString
);
Parameters
[in] wszAlgID
The encoding algorithm. Currently the only valid value is "base64".
[in] uDataLen
Length of the input data, in bytes.
[in] pbDecodedData
Pointer to the data to encode.
[in, out] puEncodedStringLen
Length of the output data, in bytes.
[out] wszEncodedString
The encoded string.
Return value
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 list. For a list of common error codes, see Common HRESULT Values.
Remarks
Note that encoding is not encrypting. Encoding does not protect content, but transforms it into a format appropriate for a specific use.
Buffer space for the encoded data must be allocated and freed by the caller. The size necessary for this buffer can be determined by calling this function with NULL in the wszEncodedString parameter.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | msdrm.h |
Library | Msdrm.lib |
DLL | Msdrm.dll |