class SSHData::PrivateKey::Base

Attributes

algo[R]
comment[R]
public_key[R]

Public Class Methods

generate(**kwargs) click to toggle source

Generate a new private key.

Returns a PublicKey::Base subclass instance.

# File lib/ssh_data/private_key/base.rb, line 14
def self.generate(**kwargs)
  raise "implement me"
end
new(**kwargs) click to toggle source
# File lib/ssh_data/private_key/base.rb, line 6
def initialize(**kwargs)
  @algo = kwargs[:algo]
  @comment = kwargs[:comment]
end

Public Instance Methods

issue_certificate(signature_algo: nil, **kwargs) click to toggle source

Issue a certificate using this private key.

signature_algo: - Optionally specify the signature algorithm to use. kwargs - See SSHData::Certificate.new.

Returns a SSHData::Certificate instance.

# File lib/ssh_data/private_key/base.rb, line 34
def issue_certificate(signature_algo: nil, **kwargs)
  Certificate.new(**kwargs).tap { |c| c.sign(self, algo: signature_algo) }
end
sign(signed_data, algo: nil) click to toggle source

Make an SSH signature.

signed_data - The String message over which to calculated the signature. algo: - Optionally specify the signature algorithm to use.

Returns a binary String signature.

# File lib/ssh_data/private_key/base.rb, line 24
def sign(signed_data, algo: nil)
  raise "implement me"
end