Share via


Stepping Through the Protected Document Library Sample

The protected document library sample shows how to use the document library.

  • Publishing a File to the Document Library
  • Obtaining and Using Protected Documents from the Library

Publishing a File to the Document Library

  1. A user saves a file locally as an .mht file.
  2. The user navigates to the sample Web page and specifies the location of the .mht file to be published.
  3. The Web application uploads the file, and the controlling class Rmhdoc uses its Publish function to encrypt the file and to get a signed issuance license that assigns rights to users. The sample determines the rights and users by examining the ACLs on the document library folder.
  4. The Web application puts the issuance license and the encrypted content into a metafile called a compound file, which it saves on the server. For more information about compound files, see Compound Files.

Obtaining and Using Protected Documents from the Library

  1. A prospective user navigates to the document library by using a Web browser, selects a document, and clicks a download button.
  2. The Web application calls its Republish method, which replaces the existing issuance license in the compound file with a newly generated one. This is done so that the latest user rights are included. If the application used the issuance license that was created when the content was first saved, the rights could be out of date.
  3. The Web application calls its PreLicense function, which copies the issuance license from the container file and sends it to the SOAP method AcquirePreLicense to get a use license. The retrieved use license is then added to the compound file.
  4. The Web application sends the compound file down to the user.
  5. The user's browser detects an .rmh file and loads the Rights Management Add-on for Internet Explorer, which binds to the use license and performs all the actions that were granted to that user (such as displaying the document, allowing the user to extract it, and so on).

See Also

Protected Document Library Sample
Protected Document Library Sample Classes and Functions

Send comments about this topic to Microsoft

Build date: 3/13/2008