class Net::SSH::Authentication::ED25519::PubKey

Attributes

verify_key[R]

Public Class Methods

new(data) click to toggle source
# File lib/net/ssh/authentication/ed25519.rb, line 32
def initialize(data)
  @verify_key = RbNaCl::Signatures::Ed25519::VerifyKey.new(data)
end
read_keyblob(buffer) click to toggle source
# File lib/net/ssh/authentication/ed25519.rb, line 36
def self.read_keyblob(buffer)
  PubKey.new(buffer.read_string)
end

Public Instance Methods

fingerprint() click to toggle source
# File lib/net/ssh/authentication/ed25519.rb, line 61
def fingerprint
  @fingerprint ||= OpenSSL::Digest::MD5.hexdigest(to_blob).scan(/../).join(":")
end
ssh_do_verify(sig,data) click to toggle source
# File lib/net/ssh/authentication/ed25519.rb, line 52
def ssh_do_verify(sig,data)
  @verify_key.verify(sig,data)
end
ssh_signature_type() click to toggle source
# File lib/net/ssh/authentication/ed25519.rb, line 48
def ssh_signature_type
  ssh_type
end
ssh_type() click to toggle source
# File lib/net/ssh/authentication/ed25519.rb, line 44
def ssh_type
  "ssh-ed25519"
end
to_blob() click to toggle source
# File lib/net/ssh/authentication/ed25519.rb, line 40
def to_blob
  Net::SSH::Buffer.from(:mstring,"ssh-ed25519",:string,@verify_key.to_bytes).to_s
end
to_pem() click to toggle source
# File lib/net/ssh/authentication/ed25519.rb, line 56
def to_pem
  # TODO this is not pem
  ssh_type + Base64.encode64(@verify_key.to_bytes)
end