hrr_rb_ssh-ed25519 0.4.0.pre3 → 0.4.0.pre4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8f8f27834eaf0442266dbfb7316a883ad2817ecd8179fe9a3305e33b1d2dc36
4
- data.tar.gz: 66d4d0e6c6b931bb519d080e8f940ff077645efa5958f9722f8a7b9ce31b7a69
3
+ metadata.gz: afbdb6f7187d4440881fc5570d5dca6efb97c6c81d058fd7b1d83213f9455efd
4
+ data.tar.gz: 701e7dfe37047f5e83a1b20904ef1a04444371981b4460dc5148e9e30d36de41
5
5
  SHA512:
6
- metadata.gz: 7864678d6b56c3ffb2fa394d30a283961f781486b2c14646724d5059c467cbade1b0d3ab965e41c1d9a6809606b5d00f817844b5bd864aac5076bdf62e419bc1
7
- data.tar.gz: aeecab19c96889503f262cd4b523c9cff46869805246dca4355c7fc13013cb5ec26a2b3fd81a04d004df78603dd375236d137b44470be5453c800cdaa565fd44
6
+ metadata.gz: cba6d7d728517b128687a745305a373901ee5f1a866f82d158ddb7383a22ad8a70098828ceac4cc23f9c9973d0b094cb17de4dc35014d7e9542896629ef4a262
7
+ data.tar.gz: e1f80be12b6e9783bc6485e782cc91f9ae50d9fa44ce43ff4914f0185bbd505029f0429805a7792e768aff3f83ca0b6c181b2deccfbe32617c922e6d94683998
@@ -25,7 +25,7 @@ module HrrRbSsh
25
25
  end
26
26
 
27
27
  def new_by_public_key_blob public_key_blob
28
- public_key_blob_h = PublicKeyBlob.decode public_key_blob, logger: logger
28
+ public_key_blob_h = PublicKeyBlob.new(logger: logger).decode public_key_blob
29
29
  @publickey = PKey.new logger: logger
30
30
  @publickey.set_public_key(public_key_blob_h[:key])
31
31
  end
@@ -39,7 +39,7 @@ module HrrRbSsh
39
39
  :'public key algorithm name' => self.class::NAME,
40
40
  :'key' => @publickey.public_key.key_str,
41
41
  }
42
- PublicKeyBlob.encode public_key_blob_h, logger: logger
42
+ PublicKeyBlob.new(logger: logger).encode public_key_blob_h
43
43
  end
44
44
 
45
45
  def sign signature_blob
@@ -47,11 +47,11 @@ module HrrRbSsh
47
47
  :'public key algorithm name' => self.class::NAME,
48
48
  :'signature blob' => @publickey.sign(signature_blob),
49
49
  }
50
- Signature.encode signature_h, logger: logger
50
+ Signature.new(logger: logger).encode signature_h
51
51
  end
52
52
 
53
53
  def verify signature, signature_blob
54
- signature_h = Signature.decode signature, logger: logger
54
+ signature_h = Signature.new(logger: logger).decode signature
55
55
  signature_h[:'public key algorithm name'] == self.class::NAME && @publickey.public_key.verify(signature_h[:'signature blob'], signature_blob)
56
56
  end
57
57
  end
@@ -8,10 +8,8 @@ module HrrRbSsh
8
8
  module Algorithm
9
9
  class Publickey
10
10
  class SshEd25519
11
- module OpenSSHPrivateKey
12
- class << self
13
- include Codable
14
- end
11
+ class OpenSSHPrivateKey
12
+ include Codable
15
13
  DEFINITION = [
16
14
  [DataType::String, :'cipher'],
17
15
  [DataType::String, :'kdfname'],
@@ -8,10 +8,8 @@ module HrrRbSsh
8
8
  module Algorithm
9
9
  class Publickey
10
10
  class SshEd25519
11
- module OpenSSHPrivateKeyContent
12
- class << self
13
- include Codable
14
- end
11
+ class OpenSSHPrivateKeyContent
12
+ include Codable
15
13
  DEFINITION = [
16
14
  [DataType::Uint64, :'unknown'],
17
15
  [DataType::String, :'name'],
@@ -50,8 +50,8 @@ module HrrRbSsh
50
50
  decoded_key_str = Base64.decode64(key_str[begin_marker.size...-end_marker.size])
51
51
  raise Error unless decoded_key_str[0,14] == magic
52
52
 
53
- private_key_h = OpenSSHPrivateKey.decode decoded_key_str[15..-1], logger: logger
54
- private_key_content_h = OpenSSHPrivateKeyContent.decode private_key_h[:'content'], logger: logger
53
+ private_key_h = OpenSSHPrivateKey.new(logger: logger).decode decoded_key_str[15..-1]
54
+ private_key_content_h = OpenSSHPrivateKeyContent.new(logger: logger).decode private_key_h[:'content']
55
55
  key_pair = private_key_content_h[:'key pair']
56
56
 
57
57
  ::Ed25519::SigningKey.new(key_pair[0,32])
@@ -8,10 +8,8 @@ module HrrRbSsh
8
8
  module Algorithm
9
9
  class Publickey
10
10
  class SshEd25519
11
- module PublicKeyBlob
12
- class << self
13
- include Codable
14
- end
11
+ class PublicKeyBlob
12
+ include Codable
15
13
  DEFINITION = [
16
14
  [DataType::String, :'public key algorithm name'],
17
15
  [DataType::String, :'key'],
@@ -8,10 +8,8 @@ module HrrRbSsh
8
8
  module Algorithm
9
9
  class Publickey
10
10
  class SshEd25519
11
- module Signature
12
- class << self
13
- include Codable
14
- end
11
+ class Signature
12
+ include Codable
15
13
  DEFINITION = [
16
14
  [DataType::String, :'public key algorithm name'],
17
15
  [DataType::String, :'signature blob'],
@@ -3,6 +3,6 @@
3
3
 
4
4
  module HrrRbSsh
5
5
  module Ed25519
6
- VERSION = "0.4.0.pre3"
6
+ VERSION = "0.4.0.pre4"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hrr_rb_ssh-ed25519
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.pre3
4
+ version: 0.4.0.pre4
5
5
  platform: ruby
6
6
  authors:
7
7
  - hirura