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
3
votes
1 answer

C# how to properly sign message with XAdES using SignedXml?

I'm struggling with message signatures using XAdES. I've searched for the solution which brought me to the code below. But the service that I'm trying to connect to is telling me that the signature is wrong. What am I doing wrong? public static…
pokrz26
  • 111
  • 1
  • 12
3
votes
0 answers

Can you sign an Xml file in .net without the private key being in the Cert Store?

I'm trying to write an app that stores that will sign xml files using certificates stored in a database (public and private keys). The issue I'm having is that whenever I load the pfx file from a file (not from the database), and try to compute the…
Martin
  • 2,180
  • 4
  • 21
  • 41
3
votes
1 answer

Verifying XML Signature in Powershell with PEM Certificate

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…
pkeenan
  • 171
  • 1
  • 7
3
votes
0 answers

Substitute for C# SignedXml in PHP

I am trying to verify IAP receipt sent for Windows Store. The code sample to verify receipt in C# is available here. I am trying to validate the receipt using PHP but not able to validate it. I am trying openssl but it is always returning 0. Is…
Ashwani K
  • 7,880
  • 19
  • 63
  • 102
2
votes
1 answer

Extract r and s from ECDSA signature signedxml c#

I'm using Signedxml class in .net 5 to generate signature using ECDSA and I need the value of r and s but I can not extract it and another problem is signature length . My signature always 64 bytes but ECDSA signature length is 71 and I do not know…
Ali
  • 50
  • 5
2
votes
1 answer

SignedXml.LoadXml() throws a CryptographicException

I have a connection to an external WebService which was running flawless for ages until medio may 2018. Suddenly I started getting a CryptographicException with the message "Malformed XML Signature". My investigation tells me the following: The…
itfar
  • 23
  • 3
2
votes
2 answers

.NET SignedXml with a Specific Namespace Prefix ("ds:") and without X509Data

I was struggling while trying to digitally sign soap envelope in Microsoft .NET. Webservice was rejecting my .NET signed request, saying “invalid signature”. In this case webservice was written in Java by third party, so i couldn't make any changes…
Mindaugas
  • 2,499
  • 1
  • 11
  • 11
2
votes
1 answer

What does the Boolean returned by SignedXml.CheckSignature actually represent?

When SignedXml.CheckSignature(AsymmetricAlgorithm key) returns true (or false), what exactly does this represent does this represent? Does this mean that the Signature is valid; or that whatever Signature object you created matches when you tried to…
Russ
  • 678
  • 8
  • 26
2
votes
1 answer

How to add prefix to Signature element in C#

We are signing a xml elements using SignedXml class. The requirement is add signature node in Ws Security to communicate with the service. We could able to sign the elements and verified those. In this case the xml Sample code is as below …
Oxygen
  • 831
  • 4
  • 17
  • 42
2
votes
1 answer

Sign XML with ECDsa and SHA256 in .Net

I'm trying to use SignedXml in .Net with ECDsa (ECDsaCng) and SHA256 and I'm getting an "CryptographicException" with message "Failed to create signing key.". Does someone knows how to achieve that goal or if I should know relevant information about…
Alejandro Morán
  • 669
  • 1
  • 13
  • 36
2
votes
0 answers

SignedXml.CheckSignature(key) always throws error

I am new to C#.NET programming. With help of online references, I have written the code below to verify signature of a SAML assertion (generated by a server API). My Env: VS 2010 Ver4.0 Win XP SP3 SAML Assertion token looks something like…
2
votes
1 answer

Xml signature validation on part of document fails in C# .NET

Given an XML document where the root node is signed with an RSA+SHA2 signature, which contains an XML element that is signed separately again with RSA+SHA2, I find that: The signature on the root node is invalid The separate signature on the child…
Wouter
  • 152
  • 7
2
votes
1 answer

Generating XADES-BES with “ds” prefix

I used signedxml class for generating xml signature. And the result xml like below;
2
votes
6 answers

Digitally Sign Parts of a XML document

I have an XML document having structure similar to the following
blaa
blaa blaa
I want to digitally sign the header and message elements and add the signature…
Eros
  • 683
  • 3
  • 10
  • 16
1
vote
1 answer

How to configure SignedXML to sign XML document with prefixes and other ceremonies?

I need to sign XML documents with a cert, using .NET Core and SignedXml, but I don't know how to configure some of the elements expected by the other side in the signature tag. I've checked many articles, one of this, authored by Rick Stahl, is…