Questions tagged [signedxml]

The SignedXml class is the main class used for XML signing and verification (XMLDSIG) in the .NET Framework.

The SignedXml 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/

70 questions
34
votes
8 answers

SignedXml.CheckSignature fails in .NET 4 but it works in .NET 3.5, 3 or 2

I have a response from a 3-rd party web service. I load an XmlDocument with that response. string txt = readStream.ReadToEnd(); response = new XmlDocument(); response.PreserveWhitespace = true; response.LoadXml(txt); return…
user1207548
  • 341
  • 1
  • 3
  • 4
12
votes
1 answer

Problem with custom namespace with SignedXml

The problem occurs when I sign XML documents containing namespace prefixes and namespace references and then validate it. The validation always fails (returns false) in this case. When I remove the namespace prefixes and namespace references from…
Aziz Mirzaev
  • 145
  • 1
  • 1
  • 8
11
votes
2 answers

XMLSigner No longer works in 4.6.2 - Malformed reference element

After Upgrading an application from 3.5 to 4.6.2 The following block of code no longer works. I get "Malformed reference element" Errors, even though it worked just fine as a 3.5 application. The code fails with the above error on what should be a…
sunrunner20
  • 191
  • 1
  • 10
10
votes
0 answers

Wrong canonicalization (c14n) made by SignedXml - it removes line breaks ( ) - is it a .NET bug?

We are receiving signed xmls from third parties which are using java. Our .NET implementation validates correctly the signatures, except when the xml contain the character reference. It looks like .NET removes that line break character…
csg
  • 2,047
  • 2
  • 22
  • 35
8
votes
1 answer

SignedXml CanonicalizationMethod - http://www.w3.org/2006/12/xml-c14n11

Is it possible to use http://www.w3.org/2006/12/xml-c14n11 CanonicalizationMethod with SignedXml? SignedXml signedXml = new SignedXml(xmlDoc); signedXml.SignedInfo.CanonicalizationMethod = "http://www.w3.org/2006/12/xml-c14n11"; is throwing…
shkipper
  • 1,403
  • 3
  • 21
  • 35
8
votes
4 answers

Signed XML signature verification for SSO SAML (Using sha256)

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…
Sandeep
  • 81
  • 1
  • 1
  • 2
7
votes
4 answers

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

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 becomes: Once this document must be signed, it's…
João Vieira
  • 1,102
  • 1
  • 13
  • 17
7
votes
1 answer

RSASSA-PSS without parameters using SHA-256 .Net 4.5 support

I'm trying to use System.Security.Cryptography (targeted framework .NET 4.5) to create xml digital signatures, so far I managed to create and verify signatures using the following scheme : RSA PKCS#1 v1.5 and SHA-256:…
Ahmad
  • 1,462
  • 15
  • 23
7
votes
3 answers

Signing an Xml Document using RSA-SHA256 signature method issue

I am using the method below to sign Xml Documents: public static XmlDocument SignDocument(XmlDocument doc) { string signatureCanonicalizationMethod = "http://www.w3.org/2001/10/xml-exc-c14n#"; string signatureMethod =…
UncleZen
  • 289
  • 1
  • 4
  • 22
6
votes
1 answer

SignedXml generates invalid signatures

I've been trying to get the XMLDSIG support in .NET to behave properly, more specifically the SignedXml class. I'm implementing a third party service and they've just recently started requiring that all messages have to be digitally signed... My…
thomasjo
  • 630
  • 6
  • 20
5
votes
1 answer

.Net: SignedXml - Signing xml with transform algorithm exc-c14n

I'm trying to sign Xml (actually SOAP xml) in C# using the SignedXml class, the signing stage passes successfully, but when I try to verify the signature it tells me that it is not valid. The only change I have done from the example in MSDN that I…
Mahmoud
  • 171
  • 4
  • 8
5
votes
2 answers

Verifying windows 8 purchases (receipts) using PHP

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…
Speedy
  • 1,361
  • 1
  • 14
  • 16
4
votes
1 answer

System.Security.Cryptography.Xml in portable class library?

I'm using a licensing tool (Rhino.Licensing) that uses signed XML files as licenses. Since the System.Security.Cryptography.Xml namespace is not available on varios platforms (like MonoTouch and Mono for Android, etc) its not possible to validate a…
dna
  • 1,498
  • 1
  • 14
  • 35
4
votes
1 answer

How to change CSP parameter of RSACryptoServiceProvider

I am doing rsa-sha256 xml signing using SignedXML class. But the problem is I need to change CSP to support sha256. This is how I am selecting certificate, public X509Certificate2 GetCertificateFromStore() { X509Store st = new…
Matt
  • 1,953
  • 1
  • 19
  • 42
3
votes
2 answers

How to verify certificate in SignedXml against machine store

I would like to verify the signature in a SignedXml against the certificates in the machine store. This code is used to verify the signature: internal bool VerifySignature(XmlDocument xml) { var signedXml = new SignedXml(xml); var nsMgr =…
Tetaxa
  • 4,375
  • 1
  • 19
  • 25
1
2 3 4 5