Vaibhav Bhandari
4/16/2008 10:50:00 PM
I tried the above but it still is not same as Java output - I want to
be able to sign and update each byte of the text instead of string
(thats what Java does) .. any ideas?
Thanks in advance.
regards,
Vaibhav
On Apr 16, 3:33 pm, Rolando Abarca <funkas...@gmail.com> wrote:
> On Apr 16, 2008, at 6:16 PM, vaibhavb wrote:
>
>
>
> > hi all -
>
> > I'm not sure if this is the correct forum but i was wondering if
> > anyone has successfully done RSA-SHA1 signing with Ruby OpenSSL and
> > interoperated with Java Servers.
>
> > I'm using the following code but i'm not sure if the "sign" method on
> > works properly -
>
> > @key = OpenSSL::PKey::RSA.new(2048)
> > #sign
> > @key.send("sign", OpenSSL::Digest.::SHA1.new, "text to sign")
>
> > The expected signature from above "sign" is not what i know the Java
> > crytpo api likes.
>
> > Thanks in advance.
>
> after digging forums and searching through the source, this is what
> i'm doing to sign:
>
> digest = OpenSSL::Digest::SHA1.new(text_to_sign)
> sign = key.private_encrypt(digest)
> # sign is what you want, if you need it in Base64:
> enc_sign = Base64.encode64(sign)
>
> > regards,
> > Vaibhav
>
> regards,
> --
> Rolando Abarca M.