XmlLicenseTransform Class
Represents the license transform algorithm used to normalize XrML licenses for signatures.
Assembly: System.Security (in System.Security.dll)
System.Security.Cryptography.Xml::Transform
System.Security.Cryptography.Xml::XmlLicenseTransform
| Name | Description | |
|---|---|---|
![]() | XmlLicenseTransform() | Initializes a new instance of the XmlLicenseTransform class. |
| 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 | |
![]() | 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(HashAlgorithm^) | |
![]() | GetHashCode() | Serves as the default hash function. (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() | |
![]() | GetXml() | |
![]() | LoadInnerXml(XmlNodeList^) | 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(Object^) | Loads the specified input into the current XmlLicenseTransform object.(Overrides Transform::LoadInput(Object^).) |
![]() | MemberwiseClone() | |
![]() | 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.
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); } } }
Available since 2.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


