notjoe
Joined: 27 Sep 2005
Posts: 5
|
Posted:
Tue Sep 27, 2005 12:29 am Post subject:
|
|
|
<?
$objChallenge = NEW COM("wmrmobjs.wmrmchallenge");
$objHeader = NEW COM("wmrmobjs.wmrmheader");
$objLic = NEW COM("wmrmobjs.wmrmlicgen");
$objKey = NEW COM("wmrmobjs.wmrmkeys");
$objres = NEW COM("wmrmobjs.WMRMResponse");
define("conpublickey", "contentserverpubkey");
define("seed","myseedkey");
define("siteurl","http://192.168.1.2/samples");
define("ownerid", "Team CMP, LLC");
define("contentserverprivkey","contentserverprikey");
define("strlicenserequested",$_POST["challenge"]);
$objChallenge->Challenge = strlicenserequested;
define("varclientinfo",$objChallenge->clientinfo);
define("varheader",$objChallenge->Header);
define("v1challenge",$objChallenge->v1challenge);
$objHeader->Header=varheader;
$CID = $objHeader->ContentID;
$res = $objHeader->Verify(conpublickey);
if ($res == 0) {
echo "invalid header";
} else {
echo "Valid Header";
}
define("kid", $objHeader->keyid);
$rid = $objHeader->Attribute("RID");
#$indiversion = $objHeader->IndividualizedVersion;
$objRights = NEW COM("wmrmobjs.wmrmrights");
if ($rid == 1) {
$objRights->MinimumAppSecurity = 500;
$objRights->AllowPlayOnPC = true;
$objRights->AllowBackupRestore = true;
$objRights->AllowTransferToSDMI = true;
$objRights->Playcount = 100;
$objRights->PMRights = 17;
$objRights->PMAppSecurity = 150;
} elseif ($rid == 2) {
$objRights->MinimumAppSecurity = 500;
$objRights->AllowPlayOnPC = true;
$objRights->AllowBackupRestore = true;
$objRights->ExpirationDate = "#20051201Z#";
$objRights->PMRights = 17;
$objRights->PMAppSecurity = 1000;
$objRights->PMExpirationDate = "#20051201Z#";
} elseif ($rid == 3) {
$objRights->MinimumAppSecurity = 500;
$objRights->AllowPlayOnPC = true;
$objRights->AllowBackupRestore = true;
$objRights->AllowTransferToSDMI = true;
$objRights->PMRights = 17;
$objRights->PMAppSecurity = 999;
} elseif ($rid == 4) {
$objRights->MinimumAppSecurity = 500;
$objRights->AllowPlayOnPC = true;
$objRights->Playcount = 2;
$objRights->AllowBackupRestore = true;
} elseif ($rid == 5) {
$objRights->MinimumAppSecurity = 500;
$objRights->AllowPlayOnPC = true;
$objRights->AllowBackupRestore = true;
$objRights->AllowTransferToSDMI = true;
$objRights->PMRights = 17;
$objRights->PMAppSecurity = 1000;
}
define("setv2rights",$objRights->GetAllRights());
$objKey->keyid=kid;
$objKey->seed=seed;
$varkey = $objKey->GenerateKey();
$objLic->keyid=kid;
$objLic->setkey("MSDRM",$varkey);
$objLic->Rights=setv2rights;
$objLic->ClientInfo=varclientinfo;
$objLic->BindToPubKey=conpublickey;
$objLic->Priority=10;
$slicense = $objLic->GetLicenseToDeliver();
$objres->AddLicense("2.0.0.0", $slicense);
$sLicResponse = addslashes($objres->GetLicenseResponse());
include("complex_ns.php"); |
|