Examples xml.Signature usage examples. Create a detached signature using a HMAC keyIn the example, an XML document ("MyDocument.xml") is loaded and signed with a HMAC key. Verify a detached signature using a HMAC keyIn the example, you verify the document signed with an HMAC key.Create an enveloping signature using a DSA keyIn this example, a XML document ("MyDocument.xml") is loaded and signed with a DSA key. Verify an enveloping signature using a X509 certificateIn this example, you verify the document (MyDocumentEnvelopingSignature.xml) signed with a DSA key.Create an enveloped signature using a RSA keyIn this code sample, a XML document ("MyDocument.xml") is loaded and signed with a RSA key. Verify an enveloped signature using a RSA keyIn this example, you verify the document (MyDocumentEnvelopedSignature.xml) signed with a RSA key.Sample: XML and signed documents Sample XML and signed documents used in xml.Signature usage examples.