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

  1. reference uri
  2. digest value
  3. signature value
  4. 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

  1. how validate xml following code

thanks in advance.

if want check if values there, use xml manipulation class xdocument.

if want verify signature need understand this:

  1. the issuer generates hash of document puts on (this digestvalue)
  2. the issuer encrypt hash private key , puts on document (this signaturevalue)
  3. 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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -