c# - Sign XML with digital signature -


i'm working web-service requires digitally signed xml posted via http post request.
gave me 1 file (key.dat) should apply xml.
how can it?

you can take on here:

private static xmlelement getxmldigitalsignature(xmldocument x, asymmetricalgorithm key) {     var signedxml = new signedxml(x) { signingkey = key };     var reference = new reference { uri = "", transformchain = new transformchain(), };      reference.addtransform(new xmldsigenvelopedsignaturetransform());      signedxml.addreference(reference);     signedxml.computesignature();      return signedxml.getxml(); }  var signature = getxmldigitalsignature(xmldocument, algorithm); xmldocument.firstchild.appendchild(xmldocument.importnode(signature, true)); 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -