Freigeben über


WMRMLicGen.MeteringCertificate

banner art

Previous Next

WMRMLicGen.MeteringCertificate

The MeteringCertificate property specifies and retrieves the metering certificate to use for metering content.

Syntax

  WMRMLicGen
  .MeteringCertificate = String
String = WMRMLicGen.MeteringCertificate

Parameters

This property takes no parameters.

Return Values

If the property succeeds, it returns a String in XML format containing a metering certificate. NULL indicates that a metering certificate has not been set. If it fails, it returns a number in the error object.

Remarks

After specifying a metering certificate, the metering ID is extracted from the certificate and is included in the license, which enables metering for the content.

Example Code

' Declare variables. 
Dim LicenseObj               ' WMRMLicGen object
Dim MeterCert                ' Metering certificate
Dim LicenseKID               ' Key ID
Dim LicenseKey               ' Key
Dim RightsString             ' Rights string
Dim varClientInfo            ' Client information
Dim ContentServerPubKey      ' Public key of the content server
Dim IndiVersion              ' Security version of the DRM component
Dim varLicense               ' License

' Specify your metering certificate (XML string). 
' VBScript requires you to use double quotes for quotes within the string.
MeterCert = "<METERCERT version=""1.0""><DATA><MID>pIKx8Wsy5aYRQN8LLIIcTQ==</MID><PUBLICKEY>nm0yQ6CXLcQIBf*Zc*VKGL!SziEdTT!ehGxDotUazwFtE7X40IlqAQ==</PUBLICKEY><URL>https://www.MyMeteringService.com</DATA><CERTIFICATECHAIN><CERTIFICATE>AAEAADgAAAB17bfg!cqDLB2clHGU7P6zkrOCVUddX95UYkqpjqvoIr4ezqw2zgwfrvKR1dq!EzdGD8ND2Ihkn0OPEoWZZKCwgidp7Y5SHR!NFJJazdPWfBQEBB4AAAABAAAAAQAAAAE=</CERTIFICATE></CERTIFICATECHAIN><SIGNATURE><HASHALGORITHM type=""SHA""></HASHALGORITHM><SIGNALGORITHM type=""MSDRM""></SIGNALGORITHM><VALUE>dvVMtj5p9o7I5IK2XIYwkQoF1Rli4cgpS1UkCjBx8KIr7SrPE9!0Vg==</VALUE></SIGNATURE></METERCERT>"

' Generate the license.
Set LicenseObj = Server.CreateObject("WMRMObjs.WMRMlicgen")
LicenseObj.KeyID = LicenseKID
LicenseObj.SetKey "", LicenseKey
LicenseObj.Priority = 10
LicenseObj.Rights = RightsString
LicenseObj.ClientInfo = varClientInfo
LicenseObj.BindToPubKey = ContentServerPubKey
LicenseObj.MeteringCertificate = MeterCert
LicenseObj.IndividualizedVersion = IndiVersion
varLicense = LicenseObj.GetLicenseToDeliver()

Requirements

Version: Windows Media Rights Manager 10 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.