Class: Net::SSH::Transport::Kex::EcdhSHA2NistP256
- Inherits:
-
DiffieHellmanGroup1SHA1
- Object
- DiffieHellmanGroup1SHA1
- Net::SSH::Transport::Kex::EcdhSHA2NistP256
- Defined in:
- lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb
Overview
A key-exchange service implementing the “ecdh-sha2-nistp256” key-exchange algorithm. (defined in RFC 5656)
Direct Known Subclasses
Constant Summary
Constants included from Constants
Constants::DEBUG, Constants::DISCONNECT, Constants::IGNORE, Constants::KEXDH_INIT, Constants::KEXDH_REPLY, Constants::KEXECDH_INIT, Constants::KEXECDH_REPLY, Constants::KEXINIT, Constants::NEWKEYS, Constants::SERVICE_ACCEPT, Constants::SERVICE_REQUEST, Constants::UNIMPLEMENTED
Constants inherited from DiffieHellmanGroup1SHA1
DiffieHellmanGroup1SHA1::G, DiffieHellmanGroup1SHA1::P_r, DiffieHellmanGroup1SHA1::P_s
Instance Attribute Summary collapse
-
#ecdh ⇒ Object
readonly
Returns the value of attribute ecdh.
Attributes included from Loggable
Attributes inherited from DiffieHellmanGroup1SHA1
#algorithms, #connection, #data, #dh, #g, #p
Instance Method Summary collapse
- #curve_name ⇒ Object
- #digester ⇒ Object
-
#initialize(algorithms, connection, data) ⇒ EcdhSHA2NistP256
constructor
A new instance of EcdhSHA2NistP256.
Methods included from Loggable
#debug, #error, #fatal, #info, #lwarn
Methods inherited from DiffieHellmanGroup1SHA1
Constructor Details
#initialize(algorithms, connection, data) ⇒ EcdhSHA2NistP256
Returns a new instance of EcdhSHA2NistP256.
21 22 23 24 25 26 27 28 29 |
# File 'lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb', line 21 def initialize(algorithms, connection, data) @algorithms = algorithms @connection = connection @digester = digester @data = data.dup @ecdh = generate_key @logger = @data.delete(:logger) end |
Instance Attribute Details
#ecdh ⇒ Object (readonly)
Returns the value of attribute ecdh.
11 12 13 |
# File 'lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb', line 11 def ecdh @ecdh end |
Instance Method Details
#curve_name ⇒ Object
17 18 19 |
# File 'lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb', line 17 def curve_name OpenSSL::PKey::EC::CurveNameAlias['nistp256'] end |
#digester ⇒ Object
13 14 15 |
# File 'lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb', line 13 def digester OpenSSL::Digest::SHA256 end |