Class: SSHData::PublicKey::SKED25519

Inherits:
ED25519 show all
Defined in:
lib/ssh_data/public_key/sked25519.rb

Instance Attribute Summary collapse

Attributes inherited from ED25519

#ed25519_key, #pk

Attributes inherited from Base

#algo

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ED25519

ed25519_gem_required!, enabled?

Methods inherited from Base

#fingerprint, #openssh, #sign

Constructor Details

#initialize(algo:, pk:, application:) ⇒ SKED25519

Returns a new instance of SKED25519.



6
7
8
9
# File 'lib/ssh_data/public_key/sked25519.rb', line 6

def initialize(algo:, pk:, application:)
  @application = application
  super(algo: algo, pk: pk)
end

Instance Attribute Details

#applicationObject (readonly)

Returns the value of attribute application.



4
5
6
# File 'lib/ssh_data/public_key/sked25519.rb', line 4

def application
  @application
end

Class Method Details

.algorithm_identifierObject



11
12
13
# File 'lib/ssh_data/public_key/sked25519.rb', line 11

def self.algorithm_identifier
  ALGO_SKED25519
end

Instance Method Details

#==(other) ⇒ Object



30
31
32
# File 'lib/ssh_data/public_key/sked25519.rb', line 30

def ==(other)
  super && other.application == application
end

#rfc4253Object

RFC4253 binary encoding of the public key.

Returns a binary String.



18
19
20
21
22
23
24
# File 'lib/ssh_data/public_key/sked25519.rb', line 18

def rfc4253
  Encoding.encode_fields(
    [:string, algo],
    [:string, pk],
    [:string, application],
  )
end

#verify(signed_data, signature) ⇒ Object

Raises:



26
27
28
# File 'lib/ssh_data/public_key/sked25519.rb', line 26

def verify(signed_data, signature)
  raise UnsupportedError, "SK-Ed25519 verification is not supported."
end