WMRMHeader.Verify
The Verify method verifies the signature in the data section of the content header.
Syntax
Long verifyResult = WMRMHeader.Verify(bstrPubKey)
Parameters
bstrPubKey
[in] String containing the public key used by Windows Media Rights Manager to verify the signature.
Return Values
If the method succeeds, it returns a Long indicating whether the signature verification succeeded (the verifyResult parameter is 1 if signature verification succeeds, 0 if it fails). If the property fails, a number is returned in the error object.
Return code | Description |
0x80004005 | An unspecified error occurred. |
0x80070057 | The specified parameter is not valid. |
Example Code
' Assume that the content packager has sent encrypted content to
' a consumer. The consumer's computer determines that a license is
' needed and issues a challenge to the license issuer. The license
' issuer can use the WMRMHeader.Verify() method to determine whether
' the header contained in the challenge is the same header sent by
' the content packager. The license issuer must use the public signing
' key sent by the content packager.
' Declare variables and objects.
Dim sHeader
Dim sPubKey
Dim lResult
Dim HeaderObj
Dim ChallengeObj
' Create objects.
Set HeaderObj = Server.CreateObject("Wmrmobjs.WMRMHeader")
Set ChallengeObj = Server.CreateObject("Wmrmobjs.WMRMChallenge")
' 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, sPubKey, created by the
' content packager.
lResult = HeaderObj.Verify(sPubKey)
if (lResult = 0) then
' The header has been corrupted.
end if
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