module PuTTY::Key::OpenSSL::RSA
The {RSA} module is included into OpenSSL::PKey::RSA
when using the PuTTY::Key
refinement or calling {PuTTY::Key.global_install}. This adds a to_ppk
instance method to OpenSSL::PKey::RSA
.
Public Instance Methods
to_ppk()
click to toggle source
Returns a new {PPK} instance that is equivalent to this key.
to_ppk
can be called on instances of OpenSSL::PKey::DSA
.
@return [PPK] A new instance of {PPK} that is equivalent to this key.
@raise [InvalidStateError] If the key has not been initialized.
# File lib/putty/key/openssl.rb, line 386 def to_ppk PPK.new.tap do |ppk| ppk.algorithm = 'ssh-rsa' begin ppk.public_blob = Util.ssh_pack('ssh-rsa', e, n) ppk.private_blob = Util.ssh_pack(d, p, q, iqmp) rescue NilValueError raise InvalidStateError, 'The key has not been fully initialized (the e, n, d, p, q and iqmp parameters must all be assigned)' end end end