From: Rick DeNatale Date: 2007-12-14T05:03:46+09:00 Subject: Re: Help with OpenSSL RSA On 12/13/07, Shandy Nantz wrote: > yermej wrote: > > On Dec 13, 9:24 am, Shandy Nantz wrote: > >> > @public_modulus = session[:public_modulus] > >> Did this ever get resolved? This is the exact problem that I am trying > >> to solve. Thanks, > >> > >> -S > >> -- > >> Posted viahttp://www.ruby-forum.com/. > > > > This seems to work if you want it as a hex string: > > > > key = OpenSSL::PKey::RSA.new(1024) > > private_key = key.to_pem > > public_modulus = key.public_key.n.to_s(16) > > public_exponent = key.public_key.e.to_s(16) > > This does work thank you. Does anyone know how to get at all the parts > that make up a public key such as the inverse? Thanks I'm pretty sure that you can't extract the inverse from a public key. The whole point of a public/private key pair is that it's extremely difficult to compute the private key from the public key. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/