[prev in list] [next in list] [prev in thread] [next in thread]
List: ruby-talk
Subject: Re: help please - openssl and ruby
From: Chris Catton <chrisc () amphora-research ! com>
Date: 2006-12-31 14:29:40
Message-ID: 5c1345130919500ae26fb483f5b8b7d8 () ruby-forum ! com
[Download RAW message or body]
Jan Svitok wrote:
>
> Summary: That shouldn't be a problem unless the n and e are somehow
> preserved.
> That obvoiusly doesn't answer your primary question... I can't say.
> Maybe format of the data? If you could post the exact data and exact
> (fully working) code, I may have a look at it.
Thanks jan - you were right that the difference between the keys was not
causing the problem. For future readers, the way to do what i was
trying to achieve is simple and obvious:
pkey=OpenSSL::PKey::RSA.new(Base64.decode64(userPublicKey))
if ( pkey.verify( OpenSSL::Digest::SHA512.new,
Base64.decode64(signatureValue), signatureText ))
puts " OK: Signature OK"
else
puts " ERROR: Signature failed"
end
I think when I first tried this, I didn't decode the signature, then saw
the difference in the keys and this threw me off track ...
C
--
Posted via http://www.ruby-forum.com/.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic