signedxml

Verifying XML Signature in Powershell with PEM Certificate

南笙酒味 提交于 2019-12-23 16:40:54
问题 I am trying to create a powershell script that will consume data with in a XML document. However, prior to doing any work I need to verify the XML hasn't been tampered with by verifying the signature. I have a copy of the public key for the cert used to sign the XML in PEM format, but I can not figure out how to get powershell to use that cert. The closes I have come to getting this to work is the following code... $Path = "data.xml" $Xmldata = new-object Xml.XmlDocument $Xmldata

How make XMLDocument do not put spaces on self-closed tags?

此生再无相见时 提交于 2019-12-22 05:08:14
问题 I have an XML well formatted without any spaces. It' must be like that. When I load it to XMLDocument to sign, the self-closing tags gets an extra white space and <cEAN/> becomes: <cEAN /> Once this document must be signed, it's impossible to remove the white space. The property PreserveWhiteSpace doesn't made any difference to the result. How can I change this behavior? 回答1: There is no space before the closing "/" in the XmlDocument . XmlDocument is a data structure consisting of nodes. It

Signed XML signature verification for SSO SAML (Using sha256)

陌路散爱 提交于 2019-12-21 09:36:59
问题 Using VS 2008 with .Net Framework 3.5 on windows 2003 server. We have implemented SSO with SAML for security. We work at service provider end where we validate the Signed XML SAML Assertuib token generated from client's system. As of now whatever signed documents we came across were using the Signature Algorithm "rsa-sha1", but now we have new customer who sends a file with the signature algorithm as "rsa-sha256" and here is the problem started. public static string VerifySignature() { if (m

Verifying windows 8 purchases (receipts) using PHP

北战南征 提交于 2019-12-18 17:00:54
问题 I need to verify in-app purchases made in Windows 8 applications server-side using PHP. MSDN's documentation page has an example only in C#. Right now I've spent a whole day by searching for a way to do it in PHP. No success. All over the internet there are only .NET examples on this topic. I've found some partial information about signed XML and x509, some libraries (xmlseclibs - useless, uses openssl_* functions which do not support sha256; phpseclib - looks promising but their

.NET doesn't support non-standard XMLDSIG signature element names

走远了吗. 提交于 2019-12-10 12:13:53
问题 I'm trying to implement an industry spec that requires enveloped XML digital signatures (XMLDSIG). Instead of conforming to the examples ( <Signature> ) my spec uses its own name for the signature element: <xs:element name="ensembleSignature" type="dsig:SignatureType" /> <!-- wish this was: <xs:element ref="dsig:Signature" /> --> So the element isn't named 'Signature' and is in the domain's XML namespace instead of the dsig XML namespace. With a lot of extra work I can create this custom

Generating xml signature with “ds” prefix

筅森魡賤 提交于 2019-12-08 05:13:37
问题 I have generated an xml signature with signedxml ,, and validation is work well. My signaturexml is like below <Signature Id="orderSignature" 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#rsa-sha1"/> <Reference URI=""> <Transforms> <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> </Transforms> <DigestMethod

How make XMLDocument do not put spaces on self-closed tags?

折月煮酒 提交于 2019-12-05 06:08:35
I have an XML well formatted without any spaces. It' must be like that. When I load it to XMLDocument to sign, the self-closing tags gets an extra white space and <cEAN/> becomes: <cEAN /> Once this document must be signed, it's impossible to remove the white space. The property PreserveWhiteSpace doesn't made any difference to the result. How can I change this behavior? There is no space before the closing "/" in the XmlDocument . XmlDocument is a data structure consisting of nodes. It is binary. It is not text. Any extra space you are seeing exists only when you serialize the document as

Signed XML signature verification for SSO SAML (Using sha256)

↘锁芯ラ 提交于 2019-12-04 03:55:44
Using VS 2008 with .Net Framework 3.5 on windows 2003 server. We have implemented SSO with SAML for security. We work at service provider end where we validate the Signed XML SAML Assertuib token generated from client's system. As of now whatever signed documents we came across were using the Signature Algorithm "rsa-sha1", but now we have new customer who sends a file with the signature algorithm as "rsa-sha256" and here is the problem started. public static string VerifySignature() { if (m_xmlDoc == null) return "Could not load XMLDocument "; try { XmlNamespaceManager nsm = new

Generating XADES-BES with “ds” prefix

江枫思渺然 提交于 2019-12-02 09:56:14
问题 I used signedxml class for generating xml signature. And the result xml like below; <Signature Id="orderSignature" 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#rsa-sha1"/> ............. ...... ... </Signature> <Object>....</Object> I need to generate XADES-BES xml format,, thats wy I want to add Prefix "ds:" to signedxml. without "ds",

Is it possible to sign an xml document without having to use KeyContainerName?

梦想的初衷 提交于 2019-11-30 20:54:18
问题 I want to create 2 really simple dlls: 1) that will sign an xml document 2) that will check that the xml document hasnt been modified. I tried using the RSACryptoServiceProvider and a key container. But when I move to a different machine this does not work as the key is being stored in the machine. I want to store the key in the dlls im creating (I know this is not reccomended) but I just cannot work out how to write some code to simply sign an xml document and then verify that it hasn't been