Share via


Decrypting Content Code Example

[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 example discussed in the following topics reads encrypted content from a custom file created by the Encrypting Content Code Example and decrypts it into the original plaintext. The file has the following format. The custom file is used only for illustration and is not suited for a production environment. For a more realistic file container format, see Publishing Content.

  • A variable that specifies the length of the encrypted content (4 byte UINT value).
  • A variable that specifies the length of the issuance license (4 byte UINT value).
  • An array of bytes that contains the encrypted content (variable length).
  • An array of bytes that contains the issuance license (variable length).

The example requires that you enter the name of the file that contains the encrypted content, the email address of the user, and the path of the application manifest. For a more complete listing, see the Consumption sample included with the Microsoft Windows Software Development Kit (SDK). The following topics discuss the source code for the decrypting example.

Decrypting Content

Encrypting Content