Well, I got my X509 code running so that it successfully generates a digital signature and adds it to the Header node of the SOAP message under construction. It loads a SOAP message that is complete but has not been signed from the file t1.xml, then signs it and writes it back to t2.xml.
And I wrote another function that tests the signature. This one loads the t2.xml file that was generated in the previous paragraph, then checks the digital signature.
Everything seems to run just fine. Only trouble is the signature check fails!
As you will see in the code below, the signature information is constructed from the cert in the "creation" method, and is loaded from the embedded tag in the SOAP header in the method that tests the signature. I've dumped out all sorts of information about both the body (that is the section being signed) and the signature itself, and everthing matches. But the CheckSignature() still returns false!
This does not seem to be that hard, but there sure are a lot of little pieces that all have to line up before anything works! Any suggestions woudl be much appreciated!
Thanks,
Brad
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Text;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
using System.Xml;
using Microsoft.Web.Services2.Security.X509;
namespace DigitalSignatureSandbox
{
/// <summary>
/// Summary description for frmMain.
/// </summary>
public class frmMain : System.Windows.Forms.Form
{
private const string SOAP_PREFIX = "soap";
private const string SOAP_NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope/";
private const string SOAP_SEC_PREFIX = "SOAP-SEC";
private const string SOAP_SEC_NAMESPACE="http://schemas.xmlsoap.org/soap/security/2000-12";
private const string DS_PREFIX = "ds";
//private const string DS_NAMESPACE = "http://www.w3.org/2000/09/xmldsig#";
private const string DS_NAMESPACE = SignedXml.XmlDsigNamespaceUrl;
private const string FOLDER = "C:/Visual Studio Projects/SOAPSandbox/SOAPSandbox/";
private const string INPUT_FILE = FOLDER + "t1.xml";
private const string OUTPUT_FILE = FOLDER + "t2.xml";
private string m_publicKey = null;
--- deleted boilerplate code generated by Visual Studio ---
private void frmMain_Load(object sender, System.EventArgs e)
{
SignSOAPMessage();
VerifySignature();
Close();
}
private void SignSOAPMessage()
{
// Load the SOAP message to be signed from a file
// ----------------------------------------------
XmlDocument document = new XmlDocument();
document.Load(INPUT_FILE);
// Load the certificate used to sign the SOAP message
// --------------------------------------------------
System.Security.Cryptography.X509Certificates.X509Certificate cert = FindCertByName("BradleyWard");
m_publicKey = cert.GetPublicKeyString();
Console.WriteLine("PublicKey=" + m_publicKey);
// Get the SOAP messages <Header> and <Body> elements.
// ---------------------------------------------------
XmlElement bodyNode = GetSingleElement("Body",SOAP_NAMESPACE,document,true);
XmlElement headerNode = GetSingleElement("Header",SOAP_NAMESPACE,document,true);
// Create the SignedXml instance that will be used
// to generate the digital signature of the
// Envelope/Body portion of the SOAP message.
// -----------------------------------------------
SignedXml signer = new SignedXml(bodyNode);
// Create a reference to the <soap:Body> element.
// ----------------------------------------------
Transform transform = new XmlDsigC14NTransform(false);
Reference reference = new Reference("#body");
reference.AddTransform(transform);
signer.AddReference(reference);
SignedInfo signedInfo = signer.SignedInfo;
// Add KeyInfo
// -----------
KeyInfo keyInfo = new KeyInfo();
DSACryptoServiceProvider key = new DSACryptoServiceProvider();
signer.SigningKey = key;
KeyInfoX509Data clause = new KeyInfoX509Data(cert);
clause.AddIssuerSerial(cert.GetIssuerName(),cert.GetSerialNumberString());
keyInfo.AddClause(clause);
signer.KeyInfo = keyInfo;
// Compute the actual digital signature
// ------------------------------------
signer.ComputeSignature();
dump("signer",signer);
XmlElement digitalSignature = signer.GetXml();
// Get the <SOAP-SEC:Security> node from the SOAP
// document being signed.
// ----------------------------------------------
XmlElement securityNode = GetSingleElement("Security",SOAP_SEC_NAMESPACE,document,false);
if (securityNode == null)
{
// <SOAP-SEC:Security> node does not exist. Create it.
// ---------------------------------------------------
securityNode = document.CreateElement(SOAP_SEC_PREFIX,"Security",SOAP_SEC_NAMESPACE);
headerNode.AppendChild(securityNode);
}
else
{
// <SOAP-SEC:Security> node DOES exist.
// Make sure it is empty.
// ------------------------------------
securityNode.RemoveAll();
}
// Add the digital signature to the
// <SOAP-SEC:Security> node.
// --------------------------------
securityNode.AppendChild(digitalSignature);
headerNode.AppendChild(securityNode);
// Save the signed SOAP message to a file
// --------------------------------------
XmlTextWriter w = new XmlTextWriter(OUTPUT_FILE,new UTF8Encoding(false));
document.WriteTo(w);
w.Close();
}
private XmlElement GetSingleElement(string localName,string namespaceURI,XmlDocument document,bool throwException)
{
XmlNodeList list = document.DocumentElement.GetElementsByTagName(localName,namespaceURI);
if (list == null || list.Count == 0)
{
if (throwException)
{
string msg = "<" + localName + "> tag in SOAP message not found!\nNamespace=" + namespaceURI;
throw new ApplicationException(msg);
}
return null;
}
else if (list.Count > 1)
{
if (throwException)
{
string msg = list.Count + " <" + localName + "> tags found in the SOAP message XML!\nNamespace=" + namespaceURI;
throw new ApplicationException(msg);
}
return null;
}
XmlElement singleElement = (XmlElement)list[0];
return singleElement;
}
/// <summary>
/// Locate a security certificate from the certificate
/// store using the certificates simple display name.
/// </summary>
/// <remarks>
/// Throws ApplicationException if the named certificate has
/// not been installed on the system.
/// </remarks>
/// <param name="simpleName">The simple display name of the cert to be located.</param>
/// <returns>The certificate.</returns>
private System.Security.Cryptography.X509Certificates.X509Certificate FindCertByName(string simpleName)
{
X509CertificateStore store = X509CertificateStore.CurrentUserStore(
X509CertificateStore.RootStore.ToString());
store.OpenRead();
foreach(Microsoft.Web.Services2.Security.X509.X509Certificate cert in store.Certificates)
{
if (simpleName.Equals(cert.SimpleDisplayName))
{
return cert;
}
}
string msg = "The '" + simpleName + "' security certificate is not installed on this system!";
throw new ApplicationException(msg);
}
private void VerifySignature()
{
XmlDocument document = new XmlDocument();
document.Load(OUTPUT_FILE);
// Get the SOAP messages <Header> and <Body> elements.
// ---------------------------------------------------
XmlElement bodyNode = GetSingleElement("Body",SOAP_NAMESPACE,document,true);
XmlElement signatureNode = GetSingleElement("Signature",SignedXml.XmlDsigNamespaceUrl,document,true);
// Create the SignedXml instance that will be used
// to verify the digital signature on the document
// -----------------------------------------------
SignedXml verifier = new SignedXml(document);
// Create a reference to the <soap:Body> element.
// ----------------------------------------------
// I've tried this with and without the next 4 lines,
// and neither approach works...
// Transform transform = new XmlDsigC14NTransform(false);
// Reference reference = new Reference("#body");
// reference.AddTransform(transform);
// verifier.AddReference(reference);
// Load the SignedXml instance from the
// XML data that is in the
// <SOAP-SEC:Security><ds:Signature> node.
// ---------------------------------------
verifier.LoadXml(signatureNode);
dump("verifier",verifier);
// Is the file secure?
// -------------------
bool isValid = verifier.CheckSignature();
string msg = "Output file isValid = " + isValid;
Console.WriteLine(msg);
MessageBox.Show(msg);
}
private void dump(string name,SignedXml signedXml)
{
XmlDocument document = signedXml.GetXml().OwnerDocument;
string signatureXML = signedXml.GetXml().OuterXml;
XmlElement bodyNode = signedXml.GetIdElement(document,"body");
string bodyXML = bodyNode.OuterXml;
string keyInfo = signedXml.KeyInfo.GetXml().OuterXml;
Console.WriteLine("----- " + name + " -----");
Console.WriteLine(" SignatureXML=" + signatureXML);
Console.WriteLine(" BodyXML=" + bodyXML);
Console.WriteLine(" Signature=" + signedXml.GetXml().OuterXml);
Console.WriteLine(" SignatureValue=" + ToString(signedXml.Signature.SignatureValue));
Console.WriteLine(" Key Info=" + keyInfo);
Console.WriteLine(" SignatureXML.HashCode = " + signatureXML.GetHashCode());
Console.WriteLine(" BodyXML.HashCode = " + bodyXML.GetHashCode());
Console.WriteLine("------------------------");
}
private string ToString(byte[] bytes)
{
StringBuilder s = new StringBuilder();
for (int i=0;i<bytes.Length;i++)
{
s.Append(String.Format("{0:d2}",bytes[i]));
s.Append(" ");
}
return s.ToString().TrimEnd();
}
}
}
Output when this program is run:
PublicKey=30818902818100E8B5B6E2914464ED1A7D8631AF8D10F5C7DB082D2DA8825A219D126AF71A827DBD71B78CA5DB57B2187759384D3FEA97876758421D1C71C2CD346E90AB1C43D9DF3FE503EC6A73D1EB6A814DF9B4EB02EA6E25829044DD0D41E76DE039541848524E3BF425967DE5BA8FAF94FE514B71EF3C937FC156389A00CEDC3A7E6EA8050203010001
----- signer -----
SignatureXML=<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" /><Reference URI="#body"><Transforms><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>9JnBIV4RUloZ1UYe6mXb7Vidouk=</DigestValue></Reference></SignedInfo><SignatureValue>gVL3o1LzaV9dTijxgjSxvux3VWE6LZhIISiha//9Xd172T3KDHzqKw==</SignatureValue><KeyInfo><X509Data xmlns="http://www.w3.org/2000/09/xmldsig#"><X509IssuerSerial><X509IssuerName>CN=Root Agency</X509IssuerName><X509SerialNumber>D02B1C98E1F3B54B9D43C56606DC20F1</X509SerialNumber></X509IssuerSerial><X509Certificate>MIIBuzCCAWWgAwIBAgIQ8SDcBmbFQ51LtfPhmBwr0DANBgkqhkiG9w0BAQQFADAWMRQwEgYDVQQDEwtSb290IEFnZW5jeTAeFw0wNTEwMTEyMzU2NTBaFw0zOTEyMzEyMzU5NTlaMBYxFDASBgNVBAMTC0JyYWRsZXlXYXJkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDotbbikURk7Rp9hjGvjRD1x9sILS2oglohnRJq9xqCfb1xt4yl21eyGHdZOE0/6peHZ1hCHRxxws00bpCrHEPZ3z/lA+xqc9HraoFN+bTrAupuJYKQRN0NQedt4DlUGEhSTjv0JZZ95bqPr5T+UUtx7zyTf8FWOJoAztw6fm6oBQIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwDQYJKoZIhvcNAQEEBQADQQBZwOR/j1C29ctTJQVmxY7VeY9r1zU6Zr/2BS9WgC4+BLmWnrOp4dXUmKP/Ebkz7mHArTjbS6o49N+xflBW91aD</X509Certificate></X509Data></KeyInfo></Signature>
BodyXML=<soap:Body Id="body" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><star:ProcessCreditApplication xmlns:star="http://www.starstandards.org/STAR" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.starstandards.org/STAR Star Rev1.1BODsProcessCreditApplication.xsd"><star:ApplicationArea><star:Sender><star:LogicalId>www.coindata.com</star:LogicalId><star:Component>DocuPen</star:Component><star:Task>CreditApplication</star:Task><star:ReferenceId>21576</star:ReferenceId><star:AuthorizationId>DocuPen</star:AuthorizationId><star:CreatorNameCode>DocuPen</star:CreatorNameCode><star:SenderNameCode>JJ</star:SenderNameCode><star:StoreNumber>1</star:StoreNumber></star:Sender><star:CreationDateTime>2005-10-10T21:29:37.04</star:CreationDateTime><star:Destination><star:DestinationNameCode>RO</star:DestinationNameCode></star:Destination></star:ApplicationArea><star:DataArea><oagis:Process xmlns:oagis="http://www.openapplications.org/oagis" /><star:CreditApplication><star:Header><star:DocumentDateTime>2005-10-10T21:29:37.04</star:DocumentDateTime><star:DocumentId>JJ-1-101</star:DocumentId><star:FinanceCompany><star:PartyId>F000JJ</star:PartyId></star:FinanceCompany><star:Dealer><star:PartyId>VJ2FO</star:PartyId></star:Dealer><star:ApplicationStatus>N</star:ApplicationStatus></star:Header><star:Detail /></star:CreditApplication></star:DataArea></star:ProcessCreditApplication></soap:Body>
Signature=<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" /><Reference URI="#body"><Transforms><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>9JnBIV4RUloZ1UYe6mXb7Vidouk=</DigestValue></Reference></SignedInfo><SignatureValue>gVL3o1LzaV9dTijxgjSxvux3VWE6LZhIISiha//9Xd172T3KDHzqKw==</SignatureValue><KeyInfo><X509Data xmlns="http://www.w3.org/2000/09/xmldsig#"><X509IssuerSerial><X509IssuerName>CN=Root Agency</X509IssuerName><X509SerialNumber>D02B1C98E1F3B54B9D43C56606DC20F1</X509SerialNumber></X509IssuerSerial><X509Certificate>MIIBuzCCAWWgAwIBAgIQ8SDcBmbFQ51LtfPhmBwr0DANBgkqhkiG9w0BAQQFADAWMRQwEgYDVQQDEwtSb290IEFnZW5jeTAeFw0wNTEwMTEyMzU2NTBaFw0zOTEyMzEyMzU5NTlaMBYxFDASBgNVBAMTC0JyYWRsZXlXYXJkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDotbbikURk7Rp9hjGvjRD1x9sILS2oglohnRJq9xqCfb1xt4yl21eyGHdZOE0/6peHZ1hCHRxxws00bpCrHEPZ3z/lA+xqc9HraoFN+bTrAupuJYKQRN0NQedt4DlUGEhSTjv0JZZ95bqPr5T+UUtx7zyTf8FWOJoAztw6fm6oBQIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwDQYJKoZIhvcNAQEEBQADQQBZwOR/j1C29ctTJQVmxY7VeY9r1zU6Zr/2BS9WgC4+BLmWnrOp4dXUmKP/Ebkz7mHArTjbS6o49N+xflBW91aD</X509Certificate></X509Data></KeyInfo></Signature>
SignatureValue=129 82 247 163 82 243 105 95 93 78 40 241 130 52 177 190 236 119 85 97 58 45 152 72 33 40 161 107 255 253 93 221 123 217 61 202 12 124 234 43
Key Info=<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><X509Data xmlns="http://www.w3.org/2000/09/xmldsig#"><X509IssuerSerial><X509IssuerName>CN=Root Agency</X509IssuerName><X509SerialNumber>D02B1C98E1F3B54B9D43C56606DC20F1</X509SerialNumber></X509IssuerSerial><X509Certificate>MIIBuzCCAWWgAwIBAgIQ8SDcBmbFQ51LtfPhmBwr0DANBgkqhkiG9w0BAQQFADAWMRQwEgYDVQQDEwtSb290IEFnZW5jeTAeFw0wNTEwMTEyMzU2NTBaFw0zOTEyMzEyMzU5NTlaMBYxFDASBgNVBAMTC0JyYWRsZXlXYXJkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDotbbikURk7Rp9hjGvjRD1x9sILS2oglohnRJq9xqCfb1xt4yl21eyGHdZOE0/6peHZ1hCHRxxws00bpCrHEPZ3z/lA+xqc9HraoFN+bTrAupuJYKQRN0NQedt4DlUGEhSTjv0JZZ95bqPr5T+UUtx7zyTf8FWOJoAztw6fm6oBQIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwDQYJKoZIhvcNAQEEBQADQQBZwOR/j1C29ctTJQVmxY7VeY9r1zU6Zr/2BS9WgC4+BLmWnrOp4dXUmKP/Ebkz7mHArTjbS6o49N+xflBW91aD</X509Certificate></X509Data></KeyInfo>
SignatureXML.HashCode = -1493349219
BodyXML.HashCode = -254931685
------------------------
----- verifier -----
SignatureXML=<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" /><Reference URI="#body"><Transforms><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>9JnBIV4RUloZ1UYe6mXb7Vidouk=</DigestValue></Reference></SignedInfo><SignatureValue>gVL3o1LzaV9dTijxgjSxvux3VWE6LZhIISiha//9Xd172T3KDHzqKw==</SignatureValue><KeyInfo><X509Data xmlns="http://www.w3.org/2000/09/xmldsig#"><X509IssuerSerial><X509IssuerName>CN=Root Agency</X509IssuerName><X509SerialNumber>D02B1C98E1F3B54B9D43C56606DC20F1</X509SerialNumber></X509IssuerSerial><X509Certificate>MIIBuzCCAWWgAwIBAgIQ8SDcBmbFQ51LtfPhmBwr0DANBgkqhkiG9w0BAQQFADAWMRQwEgYDVQQDEwtSb290IEFnZW5jeTAeFw0wNTEwMTEyMzU2NTBaFw0zOTEyMzEyMzU5NTlaMBYxFDASBgNVBAMTC0JyYWRsZXlXYXJkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDotbbikURk7Rp9hjGvjRD1x9sILS2oglohnRJq9xqCfb1xt4yl21eyGHdZOE0/6peHZ1hCHRxxws00bpCrHEPZ3z/lA+xqc9HraoFN+bTrAupuJYKQRN0NQedt4DlUGEhSTjv0JZZ95bqPr5T+UUtx7zyTf8FWOJoAztw6fm6oBQIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwDQYJKoZIhvcNAQEEBQADQQBZwOR/j1C29ctTJQVmxY7VeY9r1zU6Zr/2BS9WgC4+BLmWnrOp4dXUmKP/Ebkz7mHArTjbS6o49N+xflBW91aD</X509Certificate></X509Data></KeyInfo></Signature>
BodyXML=<soap:Body Id="body" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><star:ProcessCreditApplication xmlns:star="http://www.starstandards.org/STAR" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.starstandards.org/STAR Star Rev1.1BODsProcessCreditApplication.xsd"><star:ApplicationArea><star:Sender><star:LogicalId>www.coindata.com</star:LogicalId><star:Component>DocuPen</star:Component><star:Task>CreditApplication</star:Task><star:ReferenceId>21576</star:ReferenceId><star:AuthorizationId>DocuPen</star:AuthorizationId><star:CreatorNameCode>DocuPen</star:CreatorNameCode><star:SenderNameCode>JJ</star:SenderNameCode><star:StoreNumber>1</star:StoreNumber></star:Sender><star:CreationDateTime>2005-10-10T21:29:37.04</star:CreationDateTime><star:Destination><star:DestinationNameCode>RO</star:DestinationNameCode></star:Destination></star:ApplicationArea><star:DataArea><oagis:Process xmlns:oagis="http://www.openapplications.org/oagis" /><star:CreditApplication><star:Header><star:DocumentDateTime>2005-10-10T21:29:37.04</star:DocumentDateTime><star:DocumentId>JJ-1-101</star:DocumentId><star:FinanceCompany><star:PartyId>F000JJ</star:PartyId></star:FinanceCompany><star:Dealer><star:PartyId>VJ2FO</star:PartyId></star:Dealer><star:ApplicationStatus>N</star:ApplicationStatus></star:Header><star:Detail /></star:CreditApplication></star:DataArea></star:ProcessCreditApplication></soap:Body>
Signature=<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" /><Reference URI="#body"><Transforms><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>9JnBIV4RUloZ1UYe6mXb7Vidouk=</DigestValue></Reference></SignedInfo><SignatureValue>gVL3o1LzaV9dTijxgjSxvux3VWE6LZhIISiha//9Xd172T3KDHzqKw==</SignatureValue><KeyInfo><X509Data xmlns="http://www.w3.org/2000/09/xmldsig#"><X509IssuerSerial><X509IssuerName>CN=Root Agency</X509IssuerName><X509SerialNumber>D02B1C98E1F3B54B9D43C56606DC20F1</X509SerialNumber></X509IssuerSerial><X509Certificate>MIIBuzCCAWWgAwIBAgIQ8SDcBmbFQ51LtfPhmBwr0DANBgkqhkiG9w0BAQQFADAWMRQwEgYDVQQDEwtSb290IEFnZW5jeTAeFw0wNTEwMTEyMzU2NTBaFw0zOTEyMzEyMzU5NTlaMBYxFDASBgNVBAMTC0JyYWRsZXlXYXJkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDotbbikURk7Rp9hjGvjRD1x9sILS2oglohnRJq9xqCfb1xt4yl21eyGHdZOE0/6peHZ1hCHRxxws00bpCrHEPZ3z/lA+xqc9HraoFN+bTrAupuJYKQRN0NQedt4DlUGEhSTjv0JZZ95bqPr5T+UUtx7zyTf8FWOJoAztw6fm6oBQIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwDQYJKoZIhvcNAQEEBQADQQBZwOR/j1C29ctTJQVmxY7VeY9r1zU6Zr/2BS9WgC4+BLmWnrOp4dXUmKP/Ebkz7mHArTjbS6o49N+xflBW91aD</X509Certificate></X509Data></KeyInfo></Signature>
SignatureValue=129 82 247 163 82 243 105 95 93 78 40 241 130 52 177 190 236 119 85 97 58 45 152 72 33 40 161 107 255 253 93 221 123 217 61 202 12 124 234 43
Key Info=<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><X509Data xmlns="http://www.w3.org/2000/09/xmldsig#"><X509IssuerSerial><X509IssuerName>CN=Root Agency</X509IssuerName><X509SerialNumber>D02B1C98E1F3B54B9D43C56606DC20F1</X509SerialNumber></X509IssuerSerial><X509Certificate>MIIBuzCCAWWgAwIBAgIQ8SDcBmbFQ51LtfPhmBwr0DANBgkqhkiG9w0BAQQFADAWMRQwEgYDVQQDEwtSb290IEFnZW5jeTAeFw0wNTEwMTEyMzU2NTBaFw0zOTEyMzEyMzU5NTlaMBYxFDASBgNVBAMTC0JyYWRsZXlXYXJkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDotbbikURk7Rp9hjGvjRD1x9sILS2oglohnRJq9xqCfb1xt4yl21eyGHdZOE0/6peHZ1hCHRxxws00bpCrHEPZ3z/lA+xqc9HraoFN+bTrAupuJYKQRN0NQedt4DlUGEhSTjv0JZZ95bqPr5T+UUtx7zyTf8FWOJoAztw6fm6oBQIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwDQYJKoZIhvcNAQEEBQADQQBZwOR/j1C29ctTJQVmxY7VeY9r1zU6Zr/2BS9WgC4+BLmWnrOp4dXUmKP/Ebkz7mHArTjbS6o49N+xflBW91aD</X509Certificate></X509Data></KeyInfo>
SignatureXML.HashCode = -1493349219
BodyXML.HashCode = -254931685
------------------------
Output file isValid = False