c# - How do I decide the `DigestValue`, `SignatureValue` and `RSAKeyValue` for digital signing of XML -
i working on project need verify xml
digitally signed or not. getting hard me try , validate xml
key values following
<signature xmlns="http://www.w3.org/2000/09/xmldsig#"> <signedinfo> <canonicalizationmethod algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> <signaturemethod algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> <reference uri=**some uri value**> <transforms> <transform algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /> <transform algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> </transform> </transforms> <digestmethod algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> <digestvalue>**some digest value**</digestvalue> </reference> </signedinfo> <signaturevalue>**some signature value**</signaturevalue> <keyinfo xmlns:type="http://www.w3.org/2000/09/xmldsig#rsakeyvalue"> <rsakeyvalue><modulus>**some rsa key value**</modulus> <exponent>aqab</exponent> </rsakeyvalue> </keyinfo > </signature>
i not able trace out how can values
reference uri
digest value
signature value
rsa modulus value
can 1 tell me how can values of above? , logic behind using these combinations in xml validation?
i using c#
checking validations. can check code c# in previous questions
thanks in advance.
if want check if values there, use xml manipulation class xdocument.
if want verify signature need understand this:
- the issuer generates hash of document puts on (this digestvalue)
- the issuer encrypt hash private key , puts on document (this signaturevalue)
- the user sends certificate document (this x509certificate field).
so want check if signature valid, need decript signaturevalue public key , compare digestvalue. if both equal, document ok, if not, maybe 2 things ocurred. or document modified during process, or public key not correspondent private key encrypts document.
Comments
Post a Comment