Class: SshHostKey::Fingerprint

Inherits:
Gitlab::SSHPublicKey show all
Defined in:
app/models/ssh_host_key.rb

Constant Summary

Constants inherited from Gitlab::SSHPublicKey

Gitlab::SSHPublicKey::TECHNOLOGIES

Instance Attribute Summary collapse

Attributes inherited from Gitlab::SSHPublicKey

#key, #key_text

Instance Method Summary collapse

Methods inherited from Gitlab::SSHPublicKey

#banned?, #bits, #fingerprint, #fingerprint_sha256, sanitize, supported_algorithms, supported_algorithms_for_name, supported_sizes, supported_types, technologies, technology, technology_for_key, #type, #valid?

Constructor Details

#initialize(key, index: nil) ⇒ Fingerprint

Returns a new instance of Fingerprint.



8
9
10
11
12
# File 'app/models/ssh_host_key.rb', line 8

def initialize(key, index: nil)
  super(key)

  @index = index
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



6
7
8
# File 'app/models/ssh_host_key.rb', line 6

def index
  @index
end

Instance Method Details

#as_jsonObject



14
15
16
# File 'app/models/ssh_host_key.rb', line 14

def as_json(*)
  { bits: bits, type: type, index: index }.merge(fingerprint_data)
end