Class: Gitlab::InsecureKeyFingerprint
- Inherits:
-
Object
- Object
- Gitlab::InsecureKeyFingerprint
- Defined in:
- lib/gitlab/insecure_key_fingerprint.rb
Overview
Calculates the fingerprint of a given key without using openssh key validations. For this reason, only use for calculating the fingerprint to find the key with it.
DO NOT use it for checking the validity of a ssh key.
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
- #fingerprint_sha256 ⇒ Object
-
#initialize(key_base64) ⇒ InsecureKeyFingerprint
constructor
Gets the base64 encoded string representing a rsa or dsa key.
Constructor Details
#initialize(key_base64) ⇒ InsecureKeyFingerprint
Gets the base64 encoded string representing a rsa or dsa key
16 17 18 |
# File 'lib/gitlab/insecure_key_fingerprint.rb', line 16 def initialize(key_base64) @key = key_base64 end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
12 13 14 |
# File 'lib/gitlab/insecure_key_fingerprint.rb', line 12 def key @key end |
Instance Method Details
#fingerprint_sha256 ⇒ Object
20 21 22 |
# File 'lib/gitlab/insecure_key_fingerprint.rb', line 20 def fingerprint_sha256 Digest::SHA256.base64digest(Base64.decode64(@key)).scan(/../).join('').delete("=") end |