System.Security[00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00 07 D1 FA 57 C4 AE D9 F0 A3 2E 84 AA 0F AE FD 0D E9 E8 FD 6A EC 8F 87 FB 03 76 6C 83 4C 99 92 1E B2 3B E7 9A D9 D5 DC C1 DD 9A D2 36 13 21 02 90 0B 72 3C F9 80 95 7F C4 E1 77 10 8F C6 07 77 4F 29 E8 32 0E 92 EA 05 EC E4 E8 21 C0 A5 EF E8 F1 64 5C 4C 0C 93 C1 AB 99 28 5D 62 2C AA 65 2C 1D FA D6 3D 74 5D 6F 2D E5 F1 7E 5E AF 0F C4 96 3D 26 1C 8A 12 43 65 18 20 6D C0 93 34 4D 5A D2 93]1.0.5000.02.0.0.04.0.0.0Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.System.ObjectThe class is the main class used for XML signing and verification (XMLDSIG) in the .NET Framework. XMLDSIG is a standards-based, interoperable way to sign and verify all or part of an XML document or other data that is addressable from a Uniform Resource Identifier (URI). The .NET Framework XMLDSIG classes implement the World Wide Web Consortium (W3C) specification for XML signing and verification located at http://www.w3.org/TR/xmldsig-core/.Use the class whenever you need to share signed XML data between applications or organizations in a standard way. Any data signed using this class can be verified by any conforming implementation of the W3C specification for XMLDSIG. XMLDSIG creates a <Signature> element, which contains a digital signature of an XML document or other data that is addressable from a URI. The <Signature> element can optionally contain information about where to find a key that will verify the signature and which cryptographic algorithm was used for signing.The class allows you to create the following three kinds of XML digital signatures:Signature TypeDescriptionEnveloped signatureThe signature is contained within the XML document being signed.Enveloping signatureThe signed XML is contained within the <Signature> element.Detached signatureThe signature is in a separate document from the data being signed.Use one of the following methods to exchange key information: Do not include any key information. If you choose this option, both parties must agree on an algorithm and key before they exchange a digital signature.Include a public key in the <EncryptedKey> element.Include the location of the key in the URI attribute of the <RetrievalMethod> element. Both parties must agree on the key location ahead of time and this location must be kept secret. Include a string name that maps to a key in the <KeyName> element. Both parties must agree on the key name mapping before they exchange encrypted data and this mapping must be kept secret.Provides a wrapper on a core XML signature object to facilitate creating XML signatures.Constructor1.0.5000.02.0.0.04.0.0.0To be addedInitializes a new instance of the class.Constructor1.0.5000.02.0.0.04.0.0.0To be addedInitializes a new instance of the class from the specified XML document.The object to use to initialize the new instance of .
Constructor1.0.5000.02.0.0.04.0.0.0To be addedInitializes a new instance of the class from the specified object.The object to use to initialize the new instance of .
Method1.0.5000.02.0.0.04.0.0.0System.VoidThe method adds an <Object> element that represents an object to be signed to the <Signature> element of an XML digital signature. The method internally calls the method of the object encapsulated by the object. You can also add a object by directly calling the method from the property. For more information about XML digital signatures, see the XMLDSIG specification available at www.w3.org/TR/xmldsig-core/.Adds a object to the list of objects to be signed.The object to add to the list of objects to be signed.
Method1.0.5000.02.0.0.04.0.0.0System.VoidThe method adds a <Reference> element to the object that describes a digest method, digest value, and transform to use for creating an XML digital signature. The <Reference> element is a subelement of the <SignedInfo> element.The method internally calls the method of the object encapsulated by the object. You can also add a object by directly calling the method from the property. For more information about XML digital signatures, see the XMLDSIG specification available at www.w3.org/TR/xmldsig-core/.Adds a object to the object that describes a digest method, digest value, and transform to use for creating an XML digital signature.The object that describes a digest method, digest value, and transform to use for creating an XML digital signature.
Method1.0.5000.02.0.0.04.0.0.0System.BooleanThis method also computes the digest of the references and the value of the signature.If an XML document was signed with an X.509 signature, the method will search the "AddressBook" store for certificates suitable for the verification. For example, if the certificate is referenced by a Subject Key Identifier (SKI), the method will select certificates with this SKI and try them one after another until it can verify the certificate.Determines whether the property verifies using the public key in the signature.true if the property verifies; otherwise, false.Method1.0.5000.02.0.0.04.0.0.0System.BooleanTo be addedDetermines whether the property verifies for the specified key.true if the property verifies for the specified key; otherwise, false.The implementation of the property that holds the key to be used to verify the property.
Method1.0.5000.02.0.0.04.0.0.0System.BooleanOnly is supported by the XMLDSIG specification.This example read a XML file (document.xml) and verify if it has been signed with the shared secret "trustme".
XmlDocument doc = new XmlDocument ();
// Whitespaces are very important for XML signature!
doc.PreserveWhitespace = true;
doc.Load ("document.xml");
XmlNodeList nodeList = doc.GetElementsByTagName ("Signature", SignedXml.XmlDsigNamespaceUrl);
// only check the first signature (there could be many - or none)
XmlElement signature = (XmlElement) nodeList [0];
SignedXml s = new SignedXml ();
s.LoadXml (signature);
byte[] sharedsecret = Encoding.ASCII.GetBytes ("trustme");
HMACSHA1 mac = new HMACSHA1 (sharedsecret);
if (s.CheckSignature (mac)) {
Console.WriteLine ("Signature is valid");
}
else {
Console.WriteLine ("Invalid signature");
}
Determines whether the property verifies for the specified message authentication code (MAC) algorithm.true if the property verifies for the specified MAC; otherwise, false.The implementation of that holds the MAC to be used to verify the property.
Method2.0.0.04.0.0.0System.Runtime.InteropServices.ComVisible(false)System.BooleanIn version 1.1 of the .NET Framework, the X.509 certificate is not verified. In version 2.0 and later, the X.509 certificate is verified. In version 2.0 and later of the .NET Framework, the method will search the "AddressBook" store for certificates suitable for the verification. For example, if the certificate is referenced by a Subject Key Identifier (SKI), the method will select certificates with this SKI and try them one after another until it can verify the certificate.Determines whether the property verifies for the specified object and, optionally, whether the certificate is valid.true if the signature is valid; otherwise, false. -or-true if the signature and certificate are valid; otherwise, false. The object to use to verify the property.
true to verify the signature only; false to verify both the signature and certificate.
Method1.0.5000.02.0.0.04.0.0.0System.Boolean
an instance that verified the XML signature or null if the signature couldn't be verified using the key available in the XML document.
Check the document signature using the keys specified under the <KeyInfo> and return the public key that verified the signature.True if the signature was verified, false otherwise.False could also mean that the public key to verify the document isn't part of the document (and must be supplied independently).Method1.0.5000.02.0.0.04.0.0.0System.VoidThe method creates an XML digital signature and constructs many of the XML elements needed. You must set the data to be signed and the property before calling this method.Computes an XML digital signature.Method1.0.5000.02.0.0.04.0.0.0System.VoidThe method creates an XML digital signature using the specified MAC algorithm and constructs many of the XML elements needed. You must set the data to be signed before calling this method.Computes an XML digital signature using the specified message authentication code (MAC) algorithm.A object that holds the MAC to be used to compute the value of the property.
Property2.0.0.04.0.0.0System.Runtime.InteropServices.ComVisible(false)System.Security.Cryptography.Xml.EncryptedXmlTo be added.To be added.Gets or sets an object that defines the XML encryption processing rules.Method1.0.5000.02.0.0.04.0.0.0System.Xml.XmlElementTo be addedReturns the object with the specified ID from the specified object.The object with the specified ID from the specified object, or null if it could not be found.The object to retrieve the object from.
The ID of the object to retrieve from the object.
Method1.0.5000.02.0.0.04.0.0.0System.Security.Cryptography.AsymmetricAlgorithmThe method returns an object that contains a public key that can be used to verify an XML digital signature.The key must be either a or an key.Returns the public key of a signature.An object that contains the public key of the signature, or null if the key cannot be found.Method1.0.5000.02.0.0.04.0.0.0System.Xml.XmlElementTo be addedReturns the XML representation of a object.The XML representation of the object.Property1.0.5000.02.0.0.04.0.0.0System.Security.Cryptography.Xml.KeyInfoa The property represents the <KeyInfo> element of an XML digital signature using a object contained within the property. The <KeyInfo> element is a subelement of the <Signature> element.Use the property to embed key-related information intended to help identify the key necessary for validating an XML document.For more information about the <KeyInfo> element, see the XMLDSIG specification, which is available at www.w3.org/TR/xmldsig-core/.Gets or sets the object of the current object.Method1.0.5000.02.0.0.04.0.0.0System.VoidTo be addedLoads a state from an XML element.The XML element to load the state from.
Field1.0.5000.02.0.0.04.0.0.0System.Security.Cryptography.Xml.SignatureTo be addedRepresents the object of the current object. Field1.0.5000.02.0.0.04.0.0.0System.StringTo be addedRepresents the name of the installed key to be used for signing the object. Property1.0.5000.02.0.0.04.0.0.0System.Runtime.InteropServices.ComVisible(false)System.Xml.XmlResolvera The class resolves external XML resources named by a Uniform Resource Identifier (URI). If you do not trust the source of the XML file, you might not want to allow the XML file to access computer resources named by the URI. You can use the property to control the level of access that XML files have to computer resources by specifying different objects. If you do not want to allow any access, you can set this property to null (Nothing in Visual Basic).Sets the current object.Property1.0.5000.02.0.0.04.0.0.0System.Security.Cryptography.Xml.Signaturea The property represents the <Signature> element of an XML digital signature using a object contained within the property. The <Signature> element is the root element used for XML digital signature creation and verification. Use the property to retrieve the object used by the object.For more information about the <Signature> element, see the XMLDSIG specification, which is available at www.w3.org/TR/xmldsig-core/.Gets the object of the current object.Property1.0.5000.02.0.0.04.0.0.0System.Stringa To be addedGets the length of the signature for the current object.Property1.0.5000.02.0.0.04.0.0.0System.Stringa The property represents the <SignatureMethod> element of an XML digital signature using a Uniform Resource Identifier (URI) string contained within the property. The <SignatureMethod> element is a subelement of the <SignedInfo> element.Use the property to retrieve the <SignatureMethod> URI used by the object. This property is read only. For more information about programmatically specifying a URI for the <SignatureMethod> element, see the property.For more information about the <SignatureMethod> element, see the XMLDSIG specification, which is available at www.w3.org/TR/xmldsig-core/.Gets the signature method of the current object.Property1.0.5000.02.0.0.04.0.0.0System.Byte[]a The property represents the <SignatureValue> element of an XML digital signature using an array of bytes contained within the property. The <SignatureValue> element is a subelement of the <Signature> element.Use the property to retrieve the value of the XML digital signature. This property is automatically populated when you make a successful call to the method. For more information about the <SignatureValue> element, see the XMLDSIG specification, which is available at www.w3.org/TR/xmldsig-core/.Gets the signature value of the current object.Property1.0.5000.02.0.0.04.0.0.0System.Security.Cryptography.Xml.SignedInfoa The property represents the <SignedInfo> element of an XML digital signature using an array of bytes contained within the property. The <SignedInfo> element is a subelement of the <Signature> element.Use the property to retrieve the object that is used by the object to create an XML digital signature. For more information about the <SignedInfo> element, see the XMLDSIG specification, which is available at www.w3.org/TR/xmldsig-core/.Gets the object of the current object.Property1.0.5000.02.0.0.04.0.0.0System.Security.Cryptography.AsymmetricAlgorithma Use the property to specify the asymmetric key you want to use to create an XML digital signature.Gets or sets the asymmetric algorithm key used for signing a object.Property1.0.5000.02.0.0.04.0.0.0System.Stringa To be addedGets or sets the name of the installed key to be used for signing the object.Field2.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/2002/07/decrypt#XML".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/2002/07/decrypt#XML.Represents the Uniform Resource Identifier (URI) for the XML mode decryption transformation. This field is constant.Field2.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/2000/09/xmldsig#base64".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.The class implements the transform described by the field.For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/2000/09/xmldsig#base64.Represents the Uniform Resource Identifier (URI) for the base 64 transformation. This field is constant.Field2.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/TR/2001/REC-xml-c14n-20010315".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.The class implements the transform described by the field.For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/TR/2001/REC-xml-c14n-20010315.This field has the same value as the field.Represents the Uniform Resource Identifier (URI) for the Canonical XML transformation. This field is constant.Field2.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments ".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.The class implements the transform described by the field. For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments.This field has the same value as the field.Represents the Uniform Resource Identifier (URI) for the Canonical XML transformation, with comments. This field is constant.Field1.0.5000.02.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/TR/2001/REC-xml-c14n-20010315". Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG. The class implements the transform described by the field. For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/TR/2001/REC-xml-c14n-20010315. This field has the same value as the field.Represents the Uniform Resource Identifier (URI) for the standard canonicalization algorithm for XML digital signatures. This field is constant.Field1.0.5000.02.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG. The class implements the transform described by the field.For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments.This field has the same value as the field.Represents the Uniform Resource Identifier (URI) for the standard canonicalization algorithm for XML digital signatures and includes comments. This field is constant.Field1.0.5000.02.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/2000/09/xmldsig#dsa-sha1".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG. For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/2000/09/xmldsig#dsa-sha1.Represents the Uniform Resource Identifier (URI) for the standard algorithm for XML digital signatures. This field is constant.Field2.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/2000/09/xmldsig#enveloped-signature".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.The class implements the transform described by the field. For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/2000/09/xmldsig#enveloped-signature.Represents the Uniform Resource Identifier (URI) for enveloped signature transformation. This field is constant.Field2.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/2001/10/xml-exc-c14n#".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.The class implements the transform described by the field. For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/2001/10/xml-exc-c14n#.Represents the Uniform Resource Identifier (URI) for exclusive XML canonicalization. This field is constant.Field2.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/2001/10/xml-exc-c14n#WithComments".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.The class implements the transform described by the field.For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/2001/10/xml-exc-c14n#WithComments.Represents the Uniform Resource Identifier (URI) for exclusive XML canonicalization, with comments. This field is constant.Field1.0.5000.02.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/2000/09/xmldsig#hmac-sha1".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/2000/09/xmldsig#hmac-sha1.Represents the Uniform Resource Identifier (URI) for the standard algorithm for XML digital signatures. This field is constant.Field1.0.5000.02.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/2000/09/xmldsig#minimal".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/2000/09/xmldsig#minimal.Represents the Uniform Resource Identifier (URI) for the standard minimal canonicalization algorithm for XML digital signatures. This field is constant.Field1.0.5000.02.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/2000/09/xmldsig#".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/2000/09/xmldsig#.Represents the Uniform Resource Identifier (URI) for the standard namespace for XML digital signatures. This field is constant.Field1.0.5000.02.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/2000/09/xmldsig#rsa-sha1".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/2000/09/xmldsig#rsa-sha1.Represents the Uniform Resource Identifier (URI) for the standard signature method for XML digital signatures. This field is constant.Field1.0.5000.02.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/2000/09/xmldsig#sha1".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/2000/09/xmldsig#sha1.Represents the Uniform Resource Identifier (URI) for the standard digest method for XML digital signatures. This field is constant.Field2.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/TR/1999/REC-xpath-19991116".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.The class implements the transform described by the field.For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/TR/1999/REC-xpath-19991116.Represents the Uniform Resource Identifier (URI) for the XML Path Language (XPath). This field is constant.Field2.0.0.04.0.0.0System.StringThe value of the field is "http://www.w3.org/TR/1999/REC-xslt-19991116".Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.The class implements the transform described by the field.For more information, see the World Wide Web Consortium (W3C) specification at http://www.w3.org/TR/1999/REC-xslt-19991116.Represents the Uniform Resource Identifier (URI) for XSLT transformations. This field is constant.Field2.0.0.04.0.0.0System.StringThe value of the field is "urn:mpeg:mpeg21:2003:01-REL-R-NS:licenseTransform"Use this field to conveniently supply a value to one of the URI attributes of an element used for XMLDSIG.The class implements the transform described by the field.Represents the Uniform Resource Identifier (URI) for the license transform algorithm used to normalize XrML licenses for signatures.