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

Signing XML (XML-DSig) using HSM and PKCS11 token in .Net Core 7.0

I have X509 certificate which contains public key only in my database. The corresponding private key is store inside HSM. I found out that SignedXml class in .NET does not support signing XML in HSM. Is there any other alternative? A replacement for…
0
votes
1 answer

SignedXml CheckSignature is returning false everytime

We receive a SAML response from the client and when I am trying to validate the signature value using signedXml.CheckSignature(cert,true) then this method is returning always false. I used the example code related to CheckSignature(X509Certificate2,…
0
votes
0 answers

Signing XML in .Net with Smart Card

My client have a smart card in his computer and when he access my application through browser I can access the X509Certificate2 class of the connected smart card. The problem is that I need to sign a XML with his information and the privatekey, RSA…
0
votes
1 answer

Best practices for validating SignedXml

When would you use CheckSignature() - Determines whether the Signature property verifies using the public key in the signature. over CheckSignature(X509Certificate2, Boolean) - Determines whether the Signature property verifies for the specified…
flip
  • 391
  • 1
  • 7
  • 15
0
votes
0 answers

Signed XML Check Signature is failing with hash Error

I am trying to check SAML Signed Response in Dot Net 4.8 MVC Project My code is _xmlDoc = new XmlDocument(); _xmlDoc.PreserveWhitespace = true; _xmlDoc.XmlResolver = null; _xmlDoc.LoadXml(xml); …
0
votes
1 answer

SignedXml.LoadXML((XmlElement)nodeList[0]) throwing "Malformed element SignedInfo/Reference"

I am having trouble when reading SignedInfo from XML of a signed document, when calling SignedXml signedXml; Directory.SetCurrentDirectory(TmpDir); XmlDocument xmlDoc = new XmlDocument(); foreach(Relationship signature in signs) { …
sadis
  • 53
  • 1
  • 6
0
votes
0 answers

What is the best approach for Digital Signing a CSV file?

I am a newbie to Digital Signing and would like some advice on the best approach for this. I have an application in VB.net that does data logging to a CSV file. I need to provide a digital signature to the CSV file and from my research, it looks…
GVE
  • 1
  • 2
0
votes
0 answers

Malformed reference element occurs sporadically

I'm trying to verify the signature of an xml, I'm experiencing Malformed reference element sporadically. When I tried debugging more closely I looked at the failed XML's the getidelement is returning null for those which are failing. All the signed…
Bhaskar
  • 21
  • 1
  • 5
0
votes
1 answer

Unit Testing AppContext Switches

Change Log Renamed question: AppContext Switch Failing In Unit Test (CryptographicException: Invalid Algorithm Specified) Added section at bottom explaining the issue in further detail after doing more investigating Added section at the bottom…
Axemasta
  • 763
  • 1
  • 9
  • 24
0
votes
1 answer

VB.Net signedXml "Invalid character in a Base-64 string"

I'm getting an error everytime I try to upload a XML file to an specific server. It returns "Invalid character in a Base-64 string". Here the code I'm using to sign: Public Sub Assinar03(ByVal strArqXMLAssinar As String, ByVal strUri As String,…
douglas_forsell
  • 111
  • 1
  • 10
0
votes
1 answer

c# - validating signed XML

I have a problem with validating signed XML. Maybe you can help me :) I have an ASP.NET MVC service, which receives an XML and I need to validate if signature in this XML is valid. Certificate I'm using for validation looks like this: cert.crt…
user11207762
0
votes
1 answer

Function generating invalid digital signature

I am trying to digitally sign a XML document using SHA-1 algorithm, but the resulting signed XML has SHA-256 parts in it. I saw this question and tried to adapt it to my function, but it does not work, as it references both SHA-1 and SHA-256 on the…
Mariana
  • 160
  • 3
  • 15
0
votes
1 answer

CheckSignature returns false

I have a problem that CheckSignature on simple signing, always fails. I am using SignXml to sign some external data (in my case parts of AS4 payloads) that will be stored as MIME attachments. Here is the code (modified MS example): static string…
Kajko
  • 23
  • 7
0
votes
1 answer

Signing XML with Public Key Example?

I'm working to implement a SAML service. As such, I believe the identity provider is supposed to digitally sign the SAML assertion using the service provider's public key before sending the assertion to the service provider (which the service…
goombaloon
  • 3,039
  • 8
  • 37
  • 55
0
votes
0 answers

Can I sign XML using public key?

I'm trying to sign an XML using a public key. I'm loading the certificate from a base64 string, provided by the SP. The certificate loads fine, and the public key seems to have information in it, but when I try to use it, I get the following…
Naner
  • 1,292
  • 6
  • 25
  • 43