Class RHC::Vendor::SSHKey
In: lib/rhc/vendor/sshkey.rb
Parent: Object

Methods

Constants

SSH_TYPES = {"rsa" => "ssh-rsa", "dsa" => "ssh-dss"}
SSH_CONVERSION = {"rsa" => ["e", "n"], "dsa" => ["p", "q", "g", "pub_key"]}

External Aliases

md5_fingerprint -> fingerprint

Attributes

comment  [R] 
key_object  [R] 
passphrase  [RW] 
type  [R] 

Public Class methods

Generate a new keypair and return an SSHKey object

The default behavior when providing no options will generate a 2048-bit RSA keypair.

Parameters

  • options<~Hash>:
    • :type<~String> - "rsa" or "dsa", "rsa" by default
    • :bits<~Integer> - Bit length
    • :comment<~String> - Comment to use for the public key, defaults to ""
    • :passphrase<~String> - Encrypt the key with this passphrase

Fingerprints

Accepts either a public or private key

MD5 fingerprint for the given SSH key

Create a new SSHKey object

Parameters

  • private_key - Existing RSA or DSA private key
  • options<~Hash>
    • :comment<~String> - Comment to use for the public key, defaults to ""
    • :passphrase<~String> - If the key is encrypted, supply the passphrase

SHA1 fingerprint for the given SSH key

Validate an existing SSH public key

Returns true or false depending on the validity of the public key provided

Parameters

Public Instance methods

dsa_private_key()

Alias for private_key

dsa_public_key()

Alias for public_key

Fetch the encrypted RSA/DSA private key using the passphrase provided

If no passphrase is set, returns the unencrypted private key

fingerprint()

Alias for md5_fingerprint

Fingerprints

MD5 fingerprint for the given SSH public key

Fetch the RSA/DSA private key

rsa_private_key and dsa_private_key are aliased for backward compatibility

Fetch the RSA/DSA public key

rsa_public_key and dsa_public_key are aliased for backward compatibility

rsa_private_key()

Alias for private_key

rsa_public_key()

Alias for public_key

SHA1 fingerprint for the given SSH public key

SSH public key

[Validate]