| Author |
Message |
C#Guy
Guest
|
Posted:
Thu Dec 01, 2005 9:30 pm Post subject:
WMRMObjs.dll |
|
|
ARe there any C# examples that show how to use Windows Media Rights Manager?
|
|
| Back to top |
|
 |
Greg Rubin
Guest
|
Posted:
Fri Dec 09, 2005 9:30 pm Post subject:
Re: WMRMObjs.dll |
|
|
None officially, but I've been doing it with no real issues by just telling
VS2005 to include the dlls as references and it manages the InterOp for me.
If you want, I'll try to pull up some of my testing/learning code that I
wrote.
Greg
"C#Guy" <C#Guy@hotmail.com> wrote in message
news:EAB83C53-25CD-4BEB-9A77-8FDAFFB7224E@microsoft.com...
| Quote: | ARe there any C# examples that show how to use Windows Media Rights
Manager?
|
|
|
| Back to top |
|
 |
C#Guy
Guest
|
Posted:
Wed Dec 21, 2005 1:30 am Post subject:
Re: WMRMObjs.dll |
|
|
actual email(mark_greve@hotmail.com)
thanks
Mark
"Greg Rubin" wrote:
| Quote: | None officially, but I've been doing it with no real issues by just telling
VS2005 to include the dlls as references and it manages the InterOp for me.
If you want, I'll try to pull up some of my testing/learning code that I
wrote.
Greg
"C#Guy" <C#Guy@hotmail.com> wrote in message
news:EAB83C53-25CD-4BEB-9A77-8FDAFFB7224E@microsoft.com...
ARe there any C# examples that show how to use Windows Media Rights
Manager?
|
|
|
| Back to top |
|
 |
C#Guy
Guest
|
Posted:
Wed Dec 21, 2005 1:30 am Post subject:
Re: WMRMObjs.dll |
|
|
I was out for a little while but am back and starting back on this any
samples woud be apreciated in vs2005.
"Greg Rubin" wrote:
| Quote: | None officially, but I've been doing it with no real issues by just telling
VS2005 to include the dlls as references and it manages the InterOp for me.
If you want, I'll try to pull up some of my testing/learning code that I
wrote.
Greg
"C#Guy" <C#Guy@hotmail.com> wrote in message
news:EAB83C53-25CD-4BEB-9A77-8FDAFFB7224E@microsoft.com...
ARe there any C# examples that show how to use Windows Media Rights
Manager?
|
|
|
| Back to top |
|
 |
the dusk of Gods
Guest
|
Posted:
Wed Dec 21, 2005 9:30 am Post subject:
RE: WMRMObjs.dll |
|
|
"C#Guy" wrote:
| Quote: | ARe there any C# examples that show how to use Windows Media Rights Manager?
|
well , you want to use wmrm with C#? I think i can do that |
|
| Back to top |
|
 |
Greg Rubin
Guest
|
Posted:
Fri Dec 30, 2005 9:30 pm Post subject:
Re: WMRMObjs.dll |
|
|
I've included the file below (NNTP has just been blocked from here so I
can't post an attachment).
============= getLicense.aspx =============================
<%@ Page Language="C#" AutoEventWireup="true" Debug="true" %>
<%@ Import Namespace="WMRMOBJSLib" %>
<%
Response.BufferOutput = true;
Response.Expires = 0;
String contentowner_publickey =
(String)Application.Get("contentserverpubkey");
String key, token;
Boolean useToken = false;
MovieInfo info = null;
WMRMChallenge challenge = new WMRMChallengeClass();
WMRMHeader header = new WMRMHeaderClass();
WMRMKeys keysObj = new WMRMKeysClass();
WMRMRights rightsObj = new WMRMRightsClass();
WMRMLicGen licGen = new WMRMLicGenClass();
WMRMResponse responseObj = new WMRMResponseClass();
// We load the encrypted challenge information
challenge.Challenge = Request.Form.Get("challenge");
header.Header = challenge.Header;
keysObj.KeyID = header.KeyID;
keysObj.Seed = (String)Application.Get("seed");
key = keysObj.GenerateKey();
// Whatever individualization version they have, we accept
//licGen.IndividualizedVersion = header.in
// What do we allow? Currently, files will be valid for 1 hour,
and for 3 plays
rightsObj.MinimumSecurityLevel = 1000;
rightsObj.AllowPlay = true;
rightsObj.ExpirationOnStore = 1;
rightsObj.Playcount = 3;
rightsObj.AllowCopy = false;
rightsObj.AllowCollaborativePlay = false;
rightsObj.AllowTransferToNonSDMI = 0;
rightsObj.AllowTransferToSDMI = 0;
rightsObj.DisableOnClockRollback = 1;
rightsObj.DeleteOnClockRollback = 0;
licGen.KeyID = keysObj.KeyID;
licGen.SetKey("", key);
licGen.Priority = 0;
licGen.Rights = rightsObj.GetAllRights();
licGen.set_Attribute("Copyright", "(c) 19?? Thomas Edison");
licGen.set_Attribute("ContentType", "video");
licGen.set_Attribute("Author", "A. Niny Mouse");
licGen.set_Attribute("ArtistURL", "http://www.artist.com/");
licGen.set_Attribute("Title", "Color Bars");
licGen.set_Attribute("LicenseDistributor", "Me!");
licGen.set_Attribute("Description", "Freaking color bars, alright?");
licGen.MeteringCertificate = "<METERCERT
version=\"1.0\"><ForTestingOnly></ForTestingOnly><DATA><MID>sIikYd+wQkmV5BqrMWRoLg==</MID><URL>http://localhost/</URL><PUBLICKEY>GwaZ58UTSek9yUUsriK8*pproW*bgn6bb9QS!2I52A62iJZiTUngWA==</PUBLICKEY></DATA><CERTIFICATECHAIN><CERTIFICATE>AAEAADgAAAB17bfg!cqDLB2clHGU7P6zkrOCVUddX95UYkqpjqvoIr4ezqw2zgwfrvKR1dq!EzdGD8ND2Ihkn0OPEoWZZKCwgidp7Y5SHR!NFJJazdPWfBQEBB4AAAABAAAAAQAAAAE=</CERTIFICATE></CERTIFICATECHAIN><SIGNATURE><HASHALGORITHM
type=\"SHA\"></HASHALGORITHM><SIGNALGORITHM
type=\"MSDRM\"></SIGNALGORITHM><VALUE>E152xg8fGOwcLsacw!6ll1iasziQ*EG9ZUQjpc4GpovsHfkTmYknGg==</VALUE></SIGNATURE></METERCERT>";
licGen.ClientInfo = challenge.ClientInfo;
licGen.BindToPubKey = contentowner_publickey;
String license = licGen.GetLicenseToDeliver();
responseObj.AddLicense("2.0.0.0", license);
responseObj.ReplaceQuotesWith = "\"";
Response.Write(responseObj.GetLicenseResponse());
%> |
|
| Back to top |
|
 |
C#Guy
Guest
|
Posted:
Fri Dec 30, 2005 9:30 pm Post subject:
Re: WMRMObjs.dll |
|
|
Thanks for the help I have written something very similar and am generating
the license this
part has been very straight forward but am a little confused on saving the
license. I have built
another page much like the confirm.asp sample but now am wondering how the
object can
persist and if I should include this saving of the licese on the same page.
If you have a suggestion
on how to save the license let me know.
Thanks again.
I am your post will also help others.
"Greg Rubin" wrote:
| Quote: | I've included the file below (NNTP has just been blocked from here so I
can't post an attachment).
============= getLicense.aspx =============================
%@ Page Language="C#" AutoEventWireup="true" Debug="true" %
%@ Import Namespace="WMRMOBJSLib" %
%
Response.BufferOutput = true;
Response.Expires = 0;
String contentowner_publickey =
(String)Application.Get("contentserverpubkey");
String key, token;
Boolean useToken = false;
MovieInfo info = null;
WMRMChallenge challenge = new WMRMChallengeClass();
WMRMHeader header = new WMRMHeaderClass();
WMRMKeys keysObj = new WMRMKeysClass();
WMRMRights rightsObj = new WMRMRightsClass();
WMRMLicGen licGen = new WMRMLicGenClass();
WMRMResponse responseObj = new WMRMResponseClass();
// We load the encrypted challenge information
challenge.Challenge = Request.Form.Get("challenge");
header.Header = challenge.Header;
keysObj.KeyID = header.KeyID;
keysObj.Seed = (String)Application.Get("seed");
key = keysObj.GenerateKey();
// Whatever individualization version they have, we accept
//licGen.IndividualizedVersion = header.in
// What do we allow? Currently, files will be valid for 1 hour,
and for 3 plays
rightsObj.MinimumSecurityLevel = 1000;
rightsObj.AllowPlay = true;
rightsObj.ExpirationOnStore = 1;
rightsObj.Playcount = 3;
rightsObj.AllowCopy = false;
rightsObj.AllowCollaborativePlay = false;
rightsObj.AllowTransferToNonSDMI = 0;
rightsObj.AllowTransferToSDMI = 0;
rightsObj.DisableOnClockRollback = 1;
rightsObj.DeleteOnClockRollback = 0;
licGen.KeyID = keysObj.KeyID;
licGen.SetKey("", key);
licGen.Priority = 0;
licGen.Rights = rightsObj.GetAllRights();
licGen.set_Attribute("Copyright", "(c) 19?? Thomas Edison");
licGen.set_Attribute("ContentType", "video");
licGen.set_Attribute("Author", "A. Niny Mouse");
licGen.set_Attribute("ArtistURL", "http://www.artist.com/");
licGen.set_Attribute("Title", "Color Bars");
licGen.set_Attribute("LicenseDistributor", "Me!");
licGen.set_Attribute("Description", "Freaking color bars, alright?");
licGen.MeteringCertificate = "<METERCERT
version=\"1.0\"><ForTestingOnly></ForTestingOnly><DATA><MID>sIikYd+wQkmV5BqrMWRoLg==</MID><URL>http://localhost/</URL><PUBLICKEY>GwaZ58UTSek9yUUsriK8*pproW*bgn6bb9QS!2I52A62iJZiTUngWA==</PUBLICKEY></DATA><CERTIFICATECHAIN><CERTIFICATE>AAEAADgAAAB17bfg!cqDLB2clHGU7P6zkrOCVUddX95UYkqpjqvoIr4ezqw2zgwfrvKR1dq!EzdGD8ND2Ihkn0OPEoWZZKCwgidp7Y5SHR!NFJJazdPWfBQEBB4AAAABAAAAAQAAAAE=</CERTIFICATE></CERTIFICATECHAIN><SIGNATURE><HASHALGORITHM
type=\"SHA\"></HASHALGORITHM><SIGNALGORITHM
type=\"MSDRM\"></SIGNALGORITHM><VALUE>E152xg8fGOwcLsacw!6ll1iasziQ*EG9ZUQjpc4GpovsHfkTmYknGg==</VALUE></SIGNATURE></METERCERT>";
licGen.ClientInfo = challenge.ClientInfo;
licGen.BindToPubKey = contentowner_publickey;
String license = licGen.GetLicenseToDeliver();
responseObj.AddLicense("2.0.0.0", license);
responseObj.ReplaceQuotesWith = "\"";
Response.Write(responseObj.GetLicenseResponse());
%
|
|
|
| Back to top |
|
 |
|
|
|
|