How to Use Windows Media Rights Manager to Deliver Version 1 Licenses (319060)



The information in this article applies to:

  • Microsoft Windows Media Right Manager SDK 7.1
  • Microsoft Windows Media Right Manager SDK 7.0

This article was previously published under Q319060

SUMMARY

This article describes how to use the Windows Media Rights Manager to issue version 1 licenses. Windows Media Rights Manager is backward compatible.

MORE INFORMATION

The LicenseGenerator object is included for backward compatibility with media players that do not support Windows Media SDK version 7.0 or later. You can use the LicenseGenerator object to create Windows Media Rights Manager (WMRM) version 1 licenses. When a version 1-compatible player tries to play a packaged file, the player sends a challenge that contains the version 1 header to the license acquisition URL. The LicenseGenerator object can use the challenge to issue a version 1 license to the player.

The process for issuing a version 1 license is as follows:
  • Paste the version 1 license acquisition URL in the version 1 header when the content packager packages the content.
  • The WMRMProtect.V1LicenseAcqURL property specifies and retrieves the license acquisition URL for the version 1 content header.

    For more information about how to use the V1LicenseAcqURL property, see the Package.asp file in the Windows Media SDK sample.
  • When you try to use a version 1-compatible player (for example, Microsoft Windows Media Player 6.4) to play content, the player starts the Web browser and tries to acquire the license from the version 1 URL.
The following sample ASP page issues a version 1 license in response to a request to acquire the license from the version 1 URL:
<%
On Error Resume Next

'Get the version 1 challenge from the Request.
Set objChallenge  = Request("Challenge")

if (objChallenge <> "") then 
'Retrieve the version 1 header.
    Set objHeader  = Request("header")
    strLicense = GenV1Lic(objChallenge)
End if 
%>
<!-- #include file="license.asp" -->
<%
Set objChallenge  = Nothing
Set objHeader  = Nothing
%>

<% 
Function GenV1Lic(challenge)
    Dim v1licObj
    Dim appsec(3)
    Dim rights(7)
    Dim daysToExpire
    Dim strLicense, nIssueID
    Dim sec
'Create the LicenseGenerator object.    	
    Set v1licObj = Server.CreateObject("LicenseServer.LicenseGenerator")
    GenV1Lic = ""


'The Windows Media file can be played on the computer to which the license
'was issued, and can be transferred to a portable player with the 
'following rights.
    rights(0) = 1
    rights(1) = 1
    rights(2) = 0
    rights(3) = 0
    rights(4) = 0
    rights(5) = 0
    rights(6) = 0
    rights(7) = 0
    
'License never expires.
    daysToExpire = Null

'Set the minimum application security version.
    sec = 100
    appsec(0) = 0
    appsec(1) = ((sec \ 256) \ 256) Mod 256
    appsec(2) = (sec \ 256) Mod 256
    appsec(3) = sec Mod 256


'Retrieve the seed from Globa.asa. In reality, the seed 	
'is stored in some secure storage.
    seed = Application("seed")
    v1licObj.Set "seed", seed

    if (kid <> "") then
	'Set the Key ID.
        call v1licObj.Set("kid", kid)
    end if

'Call the IssueLicense method to generate the license. 
'Because you are not using a version 1 server to generate the  
'license, the bstrConnectionString parameter of this method is
'an empty string.
    Call v1licObj.IssueLicense("", objchallenge, 0, Null, daysToExpire, rights, appsec, strLicense, nIssueID)

    if (err.number = 0)then
        GenV1Lic = strLicense
    end if

    set v1licObj = nothing
End Function
%>

				
The License.asp file uses the Windows Media Services digital rights management (DRM) storage object to store the license on the client's computer. The following file is available for download from the Microsoft Download Center:
Release Date: 13-JUN-2002

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

REFERENCES

For more information about the LicenseGenerator object, see the Windows Media SDK Help documentation.

Modification Type:MinorLast Reviewed:8/5/2004
Keywords:kbdownload kbDSWMM2003Swept kbfile kbhowto KB319060