Compartilhar via


WMRMChallenge.Header

banner art

Previous Next

WMRMChallenge.Header

The Header property retrieves the header section from a challenge.

Syntax

  String
  
  =
  
  Header

Parameters

This property takes no parameters.

Return Values

If the property succeeds, it returns a String containing the header object. If it fails, it returns a number in the error object.

Return code Description
0x80004005 An unspecified error occurred.
0x80070057 The specified parameter is not valid.

Remarks

This property is read-only. You must pass the string containing header information to the WMRMHeader object if you want to manipulate the header before generating a license. The content header contains the following information:

  • The key ID used to create a key.
  • An optional content ID to uniquely identify the encrypted content.
  • Optional attributes that identify the content.
  • A URL identifying the Internet address of the license issuer.
  • The minimum application security version number required to play content.

Example Code

' Assume that the content packager has sent encrypted content and 
' a header to a consumer. The consumer's computer determines that 
' a license is needed and posts a challenge to the license issuer.
' The challenge contains the header sent by the content packager,
' actions requested by the client, and information about the client
' computer.
'
' For more information about the header, see the WMRMHeader object.


' Declare variables and objects.

    Dim sHeader, sClientInfo, sPubKey, lResult, dwActionCnt
    Dim sLicRequest, lIndex, sVerClient, sVerSecurity, sAppSecurity
    Dim sAction()
    Dim HeaderObj
    Dim ChallengeObj

' Create objects.

    Set HeaderObj = Server.CreateObject("Wmrmobjs.WMRMHeader")
    Set ChallengeObj = Server.CreateObject("Wmrmobjs.WMRMChallenge")
  
' Retrieve the license request from the client computer.

    sLicRequest = request.Form("challenge")

' Set the license request into the WMRMChallenge object.

    ChallengeObj.Challenge = sLicRequest

' Retrieve the header from the challenge.

    sHeader = ChallengeObj.Header

' Set the header into the WMRMHeader object.

    HeaderObj.Header = sHeader

' Verify the header with the public key created by the content
' packager.

    lResult = HeaderObj.Verify(sPubKey)
    if (lResult = 0) then
        ' The header has been corrupted.
    end if

' Retrieve the client information section of the challenge.

    sClientInfo = ChallengeObj.ClientInfo

' Retrieve attributes from the client.

    sVerClient = ChallengeObj.ClientAttribute("CLIENTVERSION" )
        ' Perform actions based on the DRM component
        ' version installed on the client computer.

    sVerSecurity = ChallengeObj.ClientAttribute("SECURITYVERSION")
        ' Perform actions based on the security version number.

    sAppSecurity  = ChallengeObj.ClientAttribute("APPSECURITY")
        ' Perform actions based on the security level of the 
        ' application on which the Windows Media file is to
        ' be played.

Requirements

Version: Windows Media Rights Manager 7 SDK or later

Reference: wmrmobjs 1.0 Type Library

Library: wmrmobjs.dll

Platform: Windows Server 2003

See Also

Previous Next

© 2007 Microsoft Corporation. All rights reserved.