Module: BeakerHcloud::SSHDataPatches::Ed25519PrivateKeyPatch

Defined in:
lib/beaker-hcloud/ssh_data_patches.rb

Overview

Add method to emit OpenSSH-encoded string

Instance Method Summary collapse

Instance Method Details

#openssh(comment: '') ⇒ Object



49
50
51
52
53
54
55
56
57
58
# File 'lib/beaker-hcloud/ssh_data_patches.rb', line 49

def openssh(comment: '')
  encoded_key = ::SSHData::Encoding.encode_openssh_private_key(
    self,
    comment,
  )
  ::SSHData::Encoding.encode_pem(
    encoded_key,
    'OPENSSH PRIVATE KEY',
  )
end