Where "key.public" contains the device's public key, converted to a decimal string, inserted into the "n" field of the structure that is read/written by Crypt::RSA::Key::Public.
That sounds problematic -- its the kind of detail I like to leave up to the author :)
?? Bug #69376 for Crypt-RSA: Bug in Crypt::RSA::Key::Private::SSH serialize function says try http://search.cpan.org/~danaj/Alt-Crypt-RSA-BigInt-0.05/
?try? Crypt::OpenSSL::RSA - RSA encoding and decoding, using the openSSL libraries
?self contained example ? Re^4: Stumped by Crypt::OpenPGP::Signature->key_id
Sorry I can't help