次の方法で共有


WMRMChallenge.RevInfoPresent

banner art

Previous Next

WMRMChallenge.RevInfoPresent

The RevInfoPresent property indicates whether a license challenge contains revocation information.

Syntax

  Boolean = WMRMChallenge
  .RevInfoPresent

Parameters

This property takes no parameters.

Return Values

If the property succeeds, it returns a Boolean indicating whether revocation information was present in the license challenge. If it fails, it returns a number in the error object.

Return code Description
0x80070057L The parameter was not set.

Remarks

This property is read-only.

Use this value as a parameter for the WMRMResponse.AddRevocationData method to include revocation data in a license.

Example Code

' Declare variables and objects.
Dim seed, contentowner_publickey, silent
Dim strLicenseRequested, varHeader
Dim kid, lResult, varKey, sRights
Dim varLicense, LicenseResponse
Dim strRevinfo, ContainsRevinfo, strClientCRLs
Dim ChallengeObj, HeaderObj, KeysObj
Dim RightsObj, LicGenObj, ResponseObj

' Replace XXX with your own values. In real practice, you would
' retrieve these values from a database.
seed = "XXX"  ' License key seed used by the packaging server.
contentowner_publickey = "XXX"  ' Public signing key for the
                                ' packaging server.
' Create objects.
Set ChallengeObj = Server.CreateObject("WMRMobjs.WMRMChallenge")
Set HeaderObj = Server.CreateObject("WMRMobjs.WMRMHeader")
Set KeysObj = Server.CreateObject("WMRMobjs.WMRMKeys")
Set RightsObj = Server.CreateObject("WMRMobjs.WMRMRights")
Set LicGenObj = Server.CreateObject("WMRMobjs.WMRMLicGen")
Set ResponseObj = Server.CreateObject("WMRMobjs.WMRMResponse")

' Find out whether the request is for silent or non-silent delivery.
silent = true
if (request.Form("nonsilent") <> "") then
    silent = false
end if

' Put the license request (challenge) into the Challenge object.
strLicenseRequested = Request.Form("challenge")
ChallengeObj.Challenge = strLicenseRequested
varHeader = ChallengeObj.Header

' Check for revocation information.
strRevinfo = ChallengeObj.RevInfo
ContainsRevinfo = ChallengeObj.RevInfoPresent

' Put the content header into the Header object. 
HeaderObj.Header = varHeader
lResult = HeaderObj.Verify(contentowner_publickey)
if (lResult = 0) then
    ' TODO: Process for a corrupted or modified header.
end if


' Put the required individualization version from the content header 
' into the WMRMLicGen object.
indiversion = HeaderObj.IndividualizedVersion
LicGenObj.IndividualizedVersion = indiversion

' Extract the key ID from the content header. Put the key ID and
' license key seed into the Keys object, and then generate the key.
kid = HeaderObj.KeyID
KeysObj.KeyID = kid
KeysObj.Seed = seed
varKey = KeysObj.GenerateKey()

' Get the certificate revocation lists that are supported by the client.
strClientCRLs = LicGenObj.SupportedCRLS

' Set the rights.
RightsObj.MinimumSecurityLevel = 1000
RightsObj.BeginDate = "#20050101Z #"
RightsObj.ExpirationDate =  "#20051231Z #"
RightsObj.AllowBackupRestore = true
RightsObj.AllowCopy = false
RightsObj.AllowTransferToSDMI = false
RightsObj.AllowTransferToNonSDMI = false
RightsObj.DeleteOnClockRollback = false
RightsObj.DisableOnClockRollback = true
SRights = RightsObj.GetAllRights

' Put the license information into the License Generator object.
' Including the following attributes is recommended.
LicGenObj.KeyID = kid
LicGenObj.SetKey "", varKey
LicGenObj.Rights = sRights
LicGenObj.Priority = 10
LicGenObj.Attribute("Copyright") = "copyright statement"
LicGenObj.Attribute("ContentType") = "audio or video"
LicGenObj.Attribute("Author") = "artist name"
LicGenObj.Attribute("ArtistURL") = "https://artist_web_site"
LicGenObj.Attribute("Title") = "title"
LicGenObj.Attribute("LicenseDistributor") = "license issuer"
LicGenObj.Attribute("LicenseDistributorURL") = "https://license_issuer_web_site"
LicGenObj.Attribute("ContentDistributor") = "content distributor"
LicGenObj.Attribute("Rating") = "rating"
LicGenObj.Attribute("Description") = "description"

' Bind the license to the public key, and then generate the license.
' GetLicenseToDeliver fails if the client has been revoked.
LicGenObj.BindToPubKey = contentowner_publickey
varLicense = LicGenObj.GetLicenseToDeliver()

' Use the Response object to deliver the license and include 
' revocation information as needed. If the client does
' not allow silent license delivery, display a page (Silent_ns.asp)
' saying that a license has been delivered.
call ResponseObj.AddLicense("2.0.0.0", varLicense)
call ResponseObj.AddRevocationData(strRevinfo, strClientCRLs, ContainsRevinfo)

if (silent = true) then
    LicenseResponse = ResponseObj.GetLicenseResponse()
    Response.Write LicenseResponse
else
'  ResponseObj.ReplaceQuotesWith = """"""    ' For VBScript
   ResponseObj.ReplaceQuotesWith = "\"""     ' For JavaScript
   LicenseResponse = ResponseObj.GetLicenseResponse()

Requirements

Version: Windows Media Rights Manager 10.1.1 SDK

Reference: wmrmobjs 1.0 Type Library

Library: wmrmobjs.dll

Platform: Windows Server 2003

See Also

Previous Next

© 2007 Microsoft Corporation. All rights reserved.