Implements a simple factory interface for fetching hmac implementations, or for finding the key lengths for hmac implementations.s
The mapping of SSH hmac algorithms to their implementations
Retrieves a new hmac instance of the given SSH
type (name
). If key
is given, the new instance
will be initialized with that key.
# File lib/net/ssh/transport/hmac.rb, line 21 def self.get(name, key="") impl = MAP[name] or raise ArgumentError, "hmac not found: #{name.inspect}" impl.new(key) end
Retrieves the key length for the hmac of the given SSH type (name
).
# File lib/net/ssh/transport/hmac.rb, line 27 def self.key_length(name) impl = MAP[name] or raise ArgumentError, "hmac not found: #{name.inspect}" impl.key_length end