CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Ruby & Ruby On Rails (http://www.codingforums.com/forumdisplay.php?f=44)
-   -   OpenSSL::PKey::RSA (http://www.codingforums.com/showthread.php?t=129590)

therealseger 12-12-2007 08:40 PM

OpenSSL::PKey::RSA
 
When creating an OpenSSL::PKey::RSA object you get an exponent and a modulus that can be used to construct the public and private key. So if I say something like:

@key = OpenSSL::PKey::RSA.new

then,

@key.e

which is the exponent I might get a number like this back:

65537 (the modulus would be a much larger number). What I need to know is, in what form is that number? Hex? Base64? The reason I need to know is because I need to take those parts of the key and place it in an xml formatted field so I can decrypt my data in VB, but VB does not like the decimal representation of that data. Thanks for any and all help,

-T

ralph l mayo 12-14-2007 08:29 PM

puts @key.e.class #=> OpenSSL::BN

It's just a regular decimal number. It may be a larger decimal number that can be represented in 32 bits though, so you'll likely need to use a big number library for VB, and transport the numbers around as strings.


All times are GMT +1. The time now is 12:46 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.