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


HRESULT DRMCreateEnablingBitsEncryptor(
  _In_     DRMHANDLE hBoundLicense,
  _In_opt_ PWSTR     wszRight,
  _In_     DRMHANDLE hAuxLib,
  _In_opt_ PWSTR     wszAuxPlug,
  _Out_    DRMHANDLE *phEncryptor
);

Parameters

hBoundLicense [in]

A handle to a bound license, produced by DRMCreateBoundLicense.

wszRight [in, optional]

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 [in]

Reserved for future use. This parameter must be NULL.

wszAuxPlug [in, optional]

Reserved for future use. This parameter must be NULL.

phEncryptor [out]

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

Product

Rights Management Services client 1.0 SP2 or later

Header

Msdrm.h

Library

Msdrm.lib

DLL

Msdrm.dll

See also

AD RMS Functions
Creating and Using Issuance Licenses
Encrypting Content
DRMCreateEnablingBitsDecryptor

 

 

Show: