Hi all,
I have a .Net webservice sending a Digital Signature within the soap
response which I am attempting to verify using the Crypto library
'RSA_verify' function on an embedded MontaVista system. I am assuming that
this is possible to do.
I have extracted the 'SignedInfo' element from the xml of the digital
signature and created a 20 byte message digest of it using SHA1 which is the
same hashing algorithm used by the web service. I have also successfully
extracted the 'SignatureValue', 'Modulus', and 'Exponent' from the xml of
the digital signature. I have assigned the modulus and exponent values to
the RSA structure. I then called 'RSA_verify' with NID_sha1, the message
digest, message digest size (20), the SignatureValue, the RSA structure size
(172) and the RSA structure. This gives an error of
"RSA_EAY_PUBLIC_DECRYPT:data too large for modulus".
I read somewhere else that the SignatureValue must be converted to binary
data which gave me a signatureValue size of 128 rather than 172 however if I
retry RSA_verify with the signature as binary data I receive the same error.
I am fairly new to this subject and to OpenSSL and I have tried to do as
much reading as possible but I'm confused about what I should be passing to
RSA_verify, in what format it should be and whether I need to format in
anyway the values I am extracting from the xml before I pass them to the
function.
Any help anyone can offer would be much appreciated.
Chris