Implements a simple factory interface for fetching hmac implementations, or for finding the key lengths for hmac implementations.s
Classes and Modules
- Net::SSH::Transport::HMAC::Abstract
- Net::SSH::Transport::HMAC::MD5
- Net::SSH::Transport::HMAC::MD5_96
- Net::SSH::Transport::HMAC::None
- Net::SSH::Transport::HMAC::RIPEMD160
- Net::SSH::Transport::HMAC::SHA1
- Net::SSH::Transport::HMAC::SHA1_96
- Net::SSH::Transport::HMAC::SHA2_256
- Net::SSH::Transport::HMAC::SHA2_256_96
- Net::SSH::Transport::HMAC::SHA2_512
- Net::SSH::Transport::HMAC::SHA2_512_96
Constants
MAP | = | { 'hmac-md5' => MD5, 'hmac-md5-96' => MD5_96, 'hmac-sha1' => SHA1, 'hmac-sha1-96' => SHA1_96, 'hmac-ripemd160' => RIPEMD160, 'hmac-ripemd160@openssh.com' => RIPEMD160, 'none' => None } |
The mapping of SSH hmac algorithms to their implementations |
Public Class methods
get
(name, key="", parameters = {})
Retrieves a new hmac instance of the given SSH type (name). If key is given, the new instance will be initialized with that key.
[show source]
# File lib/net/ssh/transport/hmac.rb, line 35 def self.get(name, key="", parameters = {}) impl = MAP[name] or raise ArgumentError, "hmac not found: #{name.inspect}" impl.new(Net::SSH::Transport::KeyExpander.expand_key(impl.key_length, key, parameters)) end
key_length
(name)
Retrieves the key length for the hmac of the given SSH type (name).
[show source]
# File lib/net/ssh/transport/hmac.rb, line 41 def self.key_length(name) impl = MAP[name] or raise ArgumentError, "hmac not found: #{name.inspect}" impl.key_length end