Class: OpenSSL::PKey::RSA

Inherits:
Object
  • Object
show all
Defined in:
lib/tpkg/thirdparty/net-ssh-2.1.0/lib/net/ssh/transport/openssl.rb

Overview

This class is originally defined in the OpenSSL module. As needed, methods have been added to it by the Net::SSH module for convenience in dealing with SSH functionality.

Instance Method Summary collapse

Instance Method Details

#ssh_do_sign(data) ⇒ Object

Returns the signature for the given data.



73
74
75
# File 'lib/tpkg/thirdparty/net-ssh-2.1.0/lib/net/ssh/transport/openssl.rb', line 73

def ssh_do_sign(data)
  sign(OpenSSL::Digest::SHA1.new, data)
end

#ssh_do_verify(sig, data) ⇒ Object

Verifies the given signature matches the given data.



68
69
70
# File 'lib/tpkg/thirdparty/net-ssh-2.1.0/lib/net/ssh/transport/openssl.rb', line 68

def ssh_do_verify(sig, data)
  verify(OpenSSL::Digest::SHA1.new, sig, data)
end

#ssh_typeObject

Returns “ssh-rsa”, which is the description of this key type used by the SSH2 protocol.



58
59
60
# File 'lib/tpkg/thirdparty/net-ssh-2.1.0/lib/net/ssh/transport/openssl.rb', line 58

def ssh_type
  "ssh-rsa"
end

#to_blobObject

Converts the key to a blob, according to the SSH2 protocol.



63
64
65
# File 'lib/tpkg/thirdparty/net-ssh-2.1.0/lib/net/ssh/transport/openssl.rb', line 63

def to_blob
  @blob ||= Net::SSH::Buffer.from(:string, ssh_type, :bignum, e, :bignum, n).to_s
end