DRMCreateEnablingBitsEncryptor 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 DRMCreateEnablingBitsEncryptor function creates an AD RMS encrypting object that is used to encrypt content data.

Syntax

DRMEXPORT HRESULT UDAPICALL DRMCreateEnablingBitsEncryptor(
  IN DRMHANDLE  hBoundLicense,
  PWSTR         wszRight,
  IN DRMHANDLE  hAuxLib,
  PWSTR         wszAuxPlug,
  OUT DRMHANDLE *phEncryptor
);

Parameters

hBoundLicense

A handle to a bound license, produced by DRMCreateBoundLicense.

wszRight

Optional null-terminated string containing a right. If you specify NULL, the AD RMS encrypting object binds to the first valid right in the license.

hAuxLib

Reserved for future use. This parameter must be NULL.

wszAuxPlug

Reserved for future use. This parameter must be NULL.

phEncryptor

A pointer to the encrypting object.

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.

Remarks

Perform the following steps to encrypt content. For more information, see Encrypting Content.

  • Acquire an end-user license. If the issuance license that you are using for this purpose was signed online, call DRMAcquireLicense followed by DRMEnumerateLicense. If the issuance license was signed offline, call DRMGetOwnerLicense instead.
  • Call DRMCreateBoundLicense to create a license that binds to the EDIT or OWNER right in the end-user license. The bound license includes a symmetric key that can be used for encryption.
  • Call DRMCreateEnablingBitsEncryptor to create an encrypting object associated with the bound right and content key.
  • Call DRMEncrypt to use the content key to encrypt the content.

Call the DRMCloseHandle function to close the encrypting object handle when you are finished with it. Both the encrypting object handle and the bound license handle must remain open until encryption is complete.

Requirements

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

See Also

AD RMS Functions

Creating and Using Issuance Licenses

DRMCreateEnablingBitsDecryptor

Encrypting Content