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
1
vote
2 answers

Use .Net Framework class in .Net Core

Hy Everyone! I'm developing a .Net Core class library project, but I have to use a class from .Net Framework DLL called System.Security, which is unavailable in Core. (The class is the SignedXml.cs in System.Security.Cryptography.Xml namespace. -…
Julius89
  • 19
  • 3
1
vote
2 answers

C# UBL 2.1 signature

I need to sign an UBL 2.1 Invoice using c#. The proble is that, after signing i need the Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" to be embeded in an UBLExtensions element, like so
MSantos
  • 53
  • 1
  • 7
1
vote
1 answer

C# Signing XML document with X509Chain

I have one question regarding signing XmlDocumentwith a chain of certificates.My current try is to load the root, intermediate and the signing certificates separately, and add them to the KeyInfoX509Data of the KeyInfo class. var keyInfo = new…
Julian
  • 375
  • 1
  • 8
  • 23
1
vote
2 answers

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

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…
Exitos
  • 29,230
  • 38
  • 123
  • 178
1
vote
2 answers

XmlDsigXPathTransform - namespace prefix is not defined

I am trying to create a signed xml detached signature file using this library: [opensbr] I need to add an xpath filter to the TransformChain but upon calling SignedXml.ComputeSignature an exception is thrown that the namespace xbrli is not valid.…
Eamonn McEvoy
  • 8,876
  • 14
  • 53
  • 83
1
vote
1 answer

How can I sign a xml file with an x509 certificate in .NET Core?

I am struggling with signing an XML document to be sent as a SAML 2.0 Request. I need to do this in Asp.Net Core. The library that would help me with this problem System.Security.Cryptography.Xml is not available in .NET Core. I was thinking if…
aodpi
  • 49
  • 1
  • 7
1
vote
0 answers

SignedXml.CheckSignature() is always false

I'm receiving signed XML from a third party with a certificate attached. I also have a copy of this certificate locally to verify that the serial numbers are equal, which they are, so I'm certain that the XML is signed by the same certificate that I…
Maritim
  • 2,111
  • 4
  • 29
  • 59
1
vote
0 answers

SignedXml not working right when verifying a signature

This this Microsoft's example of using SignedXml class to verify a signature and it didn't work for me (in Visual Studio 2013 with .NET version 4.0) due to casting XmlNode to XmlElement in the code: Boolean VerifyDetachedSignature( String^…
user4469411
1
vote
0 answers

Verifying SignedXml with dsig prefix

I'm trying to generate SignedXML with dsig prefix (which I have managed to do thanks to George Dima's answer in xml signature DS prefix?). The problem is that the CheckSignature method is now returning false - I am thinking that this method may also…
1
vote
3 answers

SignedXml.CheckSignature() is true, but SignedXml.CheckSignature(certificate) is false

I'm generating a SAML2 token from ADFS, signed by certificate. Now I'm trying to verify that signature, using the same certificate. X509Certificate2 cert = LoadCert(); XmlDocument token = LoadXmlToken(); //SAML2 token XmlElement signature =…
friggle
  • 3,362
  • 3
  • 35
  • 47
1
vote
1 answer

Storing a Large Signed UTF-8 String in SQL CE 4.0 Database

I have a SQL CE 4.0 database in which I'm storing a (potentially) large signed XML string. Currently, I'm storing this string in a column of type ntext since there is a 4000 byte limit on nvarchar (see this post). Inserting a Row So to insert a row…
Daniel Simpkins
  • 674
  • 5
  • 18
1
vote
2 answers

.Net 4.0 C# When loading SHA256 key SignatureAlgorithm changes to SHA1

I'm struggling with this now a whole week and hope someone could help me out. I need to sign xml using SHA256 and xmldsig. For this I use the SignedXML Class. When looking into this class I see it uses the SignatureAlgorithm value of the loaded key…
user2506299
  • 31
  • 1
  • 5
1
vote
0 answers

SignedXml.CheckSignature always fails when using .NET 4 or 4.5, but works in .NET 3.5, 3 or 2

I'm having troubles while trying to validate signature of signed XML document. Validation fails when using .NET framework 4.0 or 4.5, but passes in 3.5, 3.0 and 2.0. XML document is from 3rd party Java based service. Code used for signature…
1
vote
3 answers

Generating xml signature with "ds" prefix

I have generated an xml signature with signedxml ,, and validation is work well. My signaturexml is like below
Turgay Gençer
  • 121
  • 1
  • 4
  • 11
0
votes
1 answer

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

I'm trying to implement an industry spec that requires enveloped XML digital signatures (XMLDSIG). Instead of conforming to the examples () my spec uses its own name for the signature element:
yzorg
  • 4,224
  • 3
  • 39
  • 57