This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'base64' | |
require 'openssl' | |
# Parse SSH keys to be used by OpenSSL lib | |
# Taken from Zerg Support project. | |
# See: https://github.com/pwnall/zerg_support/blob/faaa5dd140c95588a1db2a25f6c9d9cacb4f9b0a/lib/zerg_support/open_ssh.rb | |
module OpenSSHKeyConverter | |
# The components in a openssh .pub / known_host RSA public key. | |
RSA_COMPONENTS = ['ssh-rsa', :e, :n] | |
# The components in a openssh .pub / known_host DSA public key. |