RSA Key Question

I want to hardcode a public RSA key into a Ruby script so there is no
reliance on an external '.pem' file. When I do that the object is of
type string and OpenSSL throws an error.

How can I get the "pub_key = OpenSSL::PKey::RSA.new(<hardcoded public

)" to recognize the key?

Thanks,
_Stud

If it expects a file, try a StringIO object with your key:

require 'stringio'
key = StringIO.new("hardcoded key")
pub_key = OpenSSL:PKey::RSA.new(key)

ยทยทยท

-----Original Message-----
From: _Stud [mailto:studlee2@gmail.com]
Sent: Wednesday, April 11, 2007 8:20 AM
To: ruby-talk ML
Subject: RSA Key Question

I want to hardcode a public RSA key into a Ruby script so there is no
reliance on an external '.pem' file. When I do that the object is of
type string and OpenSSL throws an error.

How can I get the "pub_key = OpenSSL::PKey::RSA.new(<hardcoded public

)" to recognize the key?

Thanks,
_Stud