DRMEncode function

[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(
  PWSTR       wszAlgID,
  IN UINT     uDataLen,
  IN BYTE     *pbDecodedData,
  IN OUT UINT *puEncodedStringLen,
  PWSTR       wszEncodedString
);

Parameters

wszAlgID

The encoding algorithm. Currently the only valid value is "base64".

uDataLen

Length of the input data, in bytes.

pbDecodedData

Pointer to the data to encode.

puEncodedStringLen

Length of the output data, in bytes.

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

   
Target Platform Windows
Header msdrm.h
Library Msdrm.lib
DLL Msdrm.dll

See Also

DRMDecode