Class: HrrRbSsh::Compat::OpenSSH::PublicKey
- Inherits:
-
Object
- Object
- HrrRbSsh::Compat::OpenSSH::PublicKey
- Defined in:
- lib/hrr_rb_ssh/compat/openssh/public_key.rb
Instance Method Summary collapse
- #algorithm_name ⇒ Object
-
#initialize(data_line) ⇒ PublicKey
constructor
A new instance of PublicKey.
- #to_pem ⇒ Object
Constructor Details
#initialize(data_line) ⇒ PublicKey
Returns a new instance of PublicKey.
11 12 13 14 15 16 |
# File 'lib/hrr_rb_ssh/compat/openssh/public_key.rb', line 11 def initialize data_line splitted = data_line.split(' ') @algorithm_name = splitted[0] public_key_blob = Base64.decode64(splitted[1]) @publickey = Algorithm::Publickey[@algorithm_name].new public_key_blob end |
Instance Method Details
#algorithm_name ⇒ Object
18 19 20 |
# File 'lib/hrr_rb_ssh/compat/openssh/public_key.rb', line 18 def algorithm_name @algorithm_name end |
#to_pem ⇒ Object
22 23 24 |
# File 'lib/hrr_rb_ssh/compat/openssh/public_key.rb', line 22 def to_pem @publickey.to_pem end |