XmlLicenseTransform Class
Represents the license transform algorithm used to normalize XrML licenses for signatures.
System.Security.Cryptography.Xml::Transform
System.Security.Cryptography.Xml::XmlLicenseTransform
Assembly: System.Security (in System.Security.dll)
The XmlLicenseTransform type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Algorithm | Gets or sets the Uniform Resource Identifier (URI) that identifies the algorithm performed by the current transform. (Inherited from Transform.) |
![]() | Context | Gets or sets an XmlElement object that represents the document context under which the current Transform object is running. (Inherited from Transform.) |
![]() | Decryptor | Gets or sets the decryptor of the current XmlLicenseTransform object. |
![]() | InputTypes | Gets an array of types that are valid inputs to the OutputTypes method of the current XmlLicenseTransform object. (Overrides Transform::InputTypes.) |
![]() | OutputTypes | Gets an array of types that are valid outputs from the OutputTypes method of the current XmlLicenseTransform object. (Overrides Transform::OutputTypes.) |
![]() | PropagatedNamespaces | Gets or sets a Hashtable object that contains the namespaces that are propagated into the signature. (Inherited from Transform.) |
![]() | Resolver | Sets the current XmlResolver object. (Inherited from Transform.) |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetDigestedOutput | When overridden in a derived class, returns the digest associated with a Transform object. (Inherited from Transform.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetInnerXml | Returns an XML representation of the parameters of an XmlLicenseTransform object that are suitable to be included as subelements of an XMLDSIG <Transform> element. (Overrides Transform::GetInnerXml().) |
![]() | GetOutput() | Returns the output of an XmlLicenseTransform object. (Overrides Transform::GetOutput().) |
![]() | GetOutput(Type) | Returns the output of an XmlLicenseTransform object. (Overrides Transform::GetOutput(Type).) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | GetXml | Returns the XML representation of the current Transform object. (Inherited from Transform.) |
![]() | LoadInnerXml | Parses the specified XmlNodeList object as transform-specific content of a <Transform> element; this method is not supported because the XmlLicenseTransform object has no inner XML elements. (Overrides Transform::LoadInnerXml(XmlNodeList).) |
![]() | LoadInput | Loads the specified input into the current XmlLicenseTransform object. (Overrides Transform::LoadInput(Object).) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
The XmlLicenseTransform class represents the license transform algorithm as defined in the MPEG Rights Extension Language (MPEG REL).
Use the XmlLicenseTransform class to transform XrML licenses for signatures.
The Uniform Resource Identifier (URI) that describes the XmlLicenseTransform class is defined by the XmlLicenseTransformUrl field.
Note |
|---|
The HostProtectionAttribute attribute applied to this type or member has the following Resources property value: MayLeakOnAbort. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes. |
The following code example shows how to validate an XML digital signature using the IRelDecryptor interface and the XmlLicenseTransform class.
void CheckSignatureWithEncryptedGrant( String^ fileName, IRelDecryptor^ decryptor) { // Create a new XML document. XmlDocument^ sourceDocument = gcnew XmlDocument(); XmlNamespaceManager^ namespaceManager = gcnew XmlNamespaceManager(sourceDocument->NameTable); // Format using whitespaces. sourceDocument->PreserveWhitespace = true; // Load the passed XML file into the document. sourceDocument->Load(fileName); namespaceManager->AddNamespace("dsig", SignedXml::XmlDsigNamespaceUrl); // Find the "Signature" node and create a new // XmlNodeList object. XmlNodeList^ nodeList = sourceDocument->SelectNodes("//dsig:Signature", namespaceManager); for (int i = 0, count = nodeList->Count; i < count; i++) { XmlDocument^ clone = (XmlDocument^) sourceDocument->Clone(); XmlNodeList^ signatures = clone->SelectNodes("//dsig:Signature", namespaceManager); // Create a new SignedXml object and pass into it the // XML document clone. SignedXml^ signedDocument = gcnew SignedXml(clone); // Load the signature node. signedDocument->LoadXml((XmlElement^)signatures[i]); // Set the context for license transform Transform^ licenseTransform = ((Reference^)signedDocument-> SignedInfo->References[0])->TransformChain[0]; if ((licenseTransform::typeid == XmlLicenseTransform::typeid) && (decryptor != nullptr)) { // Decryptor is used to decrypt encryptedGrant // elements. ((XmlLicenseTransform^) licenseTransform)->Decryptor = decryptor; } // Check the signature and display the result. if (signedDocument->CheckSignature()) { Console::WriteLine("SUCCESS: " + "CheckSignatureWithEncryptedGrant - issuer index #" + i); } else { Console::WriteLine("FAILURE: " + "CheckSignatureWithEncryptedGrant - issuer index #" + i); } } }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
