cose 0.9.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -1
- data/.rubocop.yml +4 -5
- data/.travis.yml +6 -7
- data/Appraisals +4 -0
- data/CHANGELOG.md +46 -1
- data/README.md +3 -3
- data/bin/setup +2 -0
- data/cose.gemspec +5 -4
- data/gemfiles/openssl_2_2.gemfile +7 -0
- data/lib/cose/algorithm.rb +4 -3
- data/lib/cose/algorithm/base.rb +0 -2
- data/lib/cose/algorithm/ecdsa.rb +20 -28
- data/lib/cose/algorithm/hmac.rb +2 -0
- data/lib/cose/algorithm/rsa_pss.rb +6 -13
- data/lib/cose/algorithm/signature_algorithm.rb +47 -0
- data/lib/cose/key.rb +13 -4
- data/lib/cose/key/base.rb +2 -4
- data/lib/cose/key/curve.rb +1 -0
- data/lib/cose/key/curve_key.rb +3 -5
- data/lib/cose/key/ec2.rb +3 -5
- data/lib/cose/key/rsa.rb +4 -6
- data/lib/cose/key/symmetric.rb +1 -1
- data/lib/cose/version.rb +1 -1
- metadata +27 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9bd8e1fa2c7e0f08d903f81ec2303a60a2377e6ba63c548b0c7f72d1c3197ee
|
4
|
+
data.tar.gz: ccf797d8600edc7020c9248db5bfc60ffdfd7c07f11f7c39cad172116176430e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f27deece5637039eb3fd8ce9a8d33baf99c31fab75036462e40d599c4e0df789cf6f5ada85fcd4df75ebfddef91faa49132b0f08486f2e322e731cf2e217808
|
7
|
+
data.tar.gz: 6eebcecddf4fc55ce1b8f7f219d9dc8bd37f1e01a18a4e3877b47b84398de883cae204d6013349e409836111b82c254a6374e9b104e552c4339ad7a94153df4b
|
data/.rspec
CHANGED
data/.rubocop.yml
CHANGED
@@ -6,7 +6,7 @@ inherit_mode:
|
|
6
6
|
- Exclude
|
7
7
|
|
8
8
|
AllCops:
|
9
|
-
TargetRubyVersion: 2.
|
9
|
+
TargetRubyVersion: 2.4
|
10
10
|
DisabledByDefault: true
|
11
11
|
Exclude:
|
12
12
|
- "gemfiles/**/*"
|
@@ -20,13 +20,12 @@ Gemspec:
|
|
20
20
|
Layout:
|
21
21
|
Enabled: true
|
22
22
|
|
23
|
+
Layout/LineLength:
|
24
|
+
Max: 120
|
25
|
+
|
23
26
|
Lint:
|
24
27
|
Enabled: true
|
25
28
|
|
26
|
-
Metrics/LineLength:
|
27
|
-
Max: 120
|
28
|
-
IgnoreCopDirectives: true
|
29
|
-
|
30
29
|
Naming:
|
31
30
|
Enabled: true
|
32
31
|
|
data/.travis.yml
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
|
1
|
+
dist: bionic
|
2
2
|
language: ruby
|
3
3
|
cache: bundler
|
4
4
|
|
5
5
|
rvm:
|
6
6
|
- ruby-head
|
7
|
-
- 2.7.
|
8
|
-
- 2.6.
|
9
|
-
- 2.5.
|
10
|
-
- 2.4.
|
11
|
-
- 2.3.8
|
7
|
+
- 2.7.1
|
8
|
+
- 2.6.6
|
9
|
+
- 2.5.8
|
10
|
+
- 2.4.10
|
12
11
|
|
13
12
|
gemfile:
|
14
13
|
- gemfiles/openssl_head.gemfile
|
14
|
+
- gemfiles/openssl_2_2.gemfile
|
15
15
|
- gemfiles/openssl_2_1.gemfile
|
16
16
|
- gemfiles/openssl_2_0.gemfile
|
17
17
|
- gemfiles/openssl_default.gemfile
|
@@ -22,5 +22,4 @@ matrix:
|
|
22
22
|
fast_finish: true
|
23
23
|
allow_failures:
|
24
24
|
- rvm: ruby-head
|
25
|
-
- rvm: 2.7.0-preview1
|
26
25
|
- gemfile: gemfiles/openssl_head.gemfile
|
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,45 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v1.2.0] - 2020-07-10
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
- Support ES256K signature algorithm
|
8
|
+
|
9
|
+
## [v1.1.0] - 2020-07-09
|
10
|
+
|
11
|
+
### Dependencies
|
12
|
+
|
13
|
+
- Update `openssl-signature_algorithm` runtime dependency from `~> 0.4.0` to `~> 1.0`.
|
14
|
+
|
15
|
+
## [v1.0.0] - 2020-03-29
|
16
|
+
|
17
|
+
### Added
|
18
|
+
|
19
|
+
- Signature verification validates key `alg` is compatible with the signature algorithm
|
20
|
+
|
21
|
+
NOTE: No breaking changes. Moving out of `v0.x` to express the intention to keep the public API stable.
|
22
|
+
|
23
|
+
## [v0.11.0] - 2020-01-30
|
24
|
+
|
25
|
+
### Added
|
26
|
+
|
27
|
+
- Let others easily support more signature algorithms by making `COSE::Algorithm::SignatureAlgorithm` smarter
|
28
|
+
|
29
|
+
## [v0.10.0] - 2019-12-19
|
30
|
+
|
31
|
+
### Added
|
32
|
+
|
33
|
+
- Works on ruby 2.7 without throwing any warnings
|
34
|
+
- Simpler way to rescue key deserialization error, now possible to:
|
35
|
+
```rb
|
36
|
+
begin
|
37
|
+
COSE::Key.deserialize(cbor)
|
38
|
+
rescue COSE::KeyDeserializationError
|
39
|
+
# handle error
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
3
43
|
## [v0.9.0] - 2019-08-31
|
4
44
|
|
5
45
|
### Added
|
@@ -95,7 +135,12 @@
|
|
95
135
|
- EC2 key object
|
96
136
|
- Works with ruby 2.5
|
97
137
|
|
98
|
-
[
|
138
|
+
[v1.2.0]: https://github.com/cedarcode/cose-ruby/compare/v1.1.0...v1.2.0/
|
139
|
+
[v1.1.0]: https://github.com/cedarcode/cose-ruby/compare/v1.0.0...v1.1.0/
|
140
|
+
[v1.0.0]: https://github.com/cedarcode/cose-ruby/compare/v0.11.0...v1.0.0/
|
141
|
+
[v0.11.0]: https://github.com/cedarcode/cose-ruby/compare/v0.10.0...v0.11.0/
|
142
|
+
[v0.10.0]: https://github.com/cedarcode/cose-ruby/compare/v0.9.0...v0.10.0/
|
143
|
+
[v0.9.0]: https://github.com/cedarcode/cose-ruby/compare/v0.8.0...v0.9.0/
|
99
144
|
[v0.8.0]: https://github.com/cedarcode/cose-ruby/compare/v0.7.0...v0.8.0/
|
100
145
|
[v0.7.0]: https://github.com/cedarcode/cose-ruby/compare/v0.6.1...v0.7.0/
|
101
146
|
[v0.6.1]: https://github.com/cedarcode/cose-ruby/compare/v0.6.0...v0.6.1/
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# cose
|
1
|
+
# cose-ruby
|
2
2
|
|
3
|
-
Ruby implementation of RFC 8152 CBOR Object Signing and Encryption (COSE)
|
3
|
+
Ruby implementation of RFC [8152](https://tools.ietf.org/html/rfc8152) CBOR Object Signing and Encryption (COSE)
|
4
4
|
|
5
|
-
[![Gem](https://img.shields.io/gem/v/cose.svg?style=flat-square)](https://rubygems.org/gems/cose)
|
5
|
+
[![Gem](https://img.shields.io/gem/v/cose.svg?style=flat-square&color=informational)](https://rubygems.org/gems/cose)
|
6
6
|
[![Travis](https://img.shields.io/travis/cedarcode/cose-ruby.svg?style=flat-square)](https://travis-ci.org/cedarcode/cose-ruby)
|
7
7
|
|
8
8
|
## Installation
|
data/bin/setup
CHANGED
data/cose.gemspec
CHANGED
@@ -29,15 +29,16 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
32
|
-
spec.required_ruby_version = ">= 2.
|
32
|
+
spec.required_ruby_version = ">= 2.4"
|
33
33
|
|
34
34
|
spec.add_dependency "cbor", "~> 0.5.9"
|
35
|
+
spec.add_dependency "openssl-signature_algorithm", "~> 1.0"
|
35
36
|
|
36
37
|
spec.add_development_dependency "appraisal", "~> 2.2.0"
|
37
38
|
spec.add_development_dependency "bundler", ">= 1.17", "< 3"
|
38
|
-
spec.add_development_dependency "byebug", "
|
39
|
-
spec.add_development_dependency "rake", "~>
|
39
|
+
spec.add_development_dependency "byebug", "~> 11.0"
|
40
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
40
41
|
spec.add_development_dependency "rspec", "~> 3.8"
|
41
|
-
spec.add_development_dependency "rubocop", "0.
|
42
|
+
spec.add_development_dependency "rubocop", "0.80.1"
|
42
43
|
spec.add_development_dependency "rubocop-performance", "~> 1.4"
|
43
44
|
end
|
data/lib/cose/algorithm.rb
CHANGED
@@ -26,9 +26,10 @@ module COSE
|
|
26
26
|
@registered_by_name[name]
|
27
27
|
end
|
28
28
|
|
29
|
-
register(ECDSA.new(-7, "ES256", hash_function: "SHA256"))
|
30
|
-
register(ECDSA.new(-35, "ES384", hash_function: "SHA384"))
|
31
|
-
register(ECDSA.new(-36, "ES512", hash_function: "SHA512"))
|
29
|
+
register(ECDSA.new(-7, "ES256", hash_function: "SHA256", curve_name: "P-256"))
|
30
|
+
register(ECDSA.new(-35, "ES384", hash_function: "SHA384", curve_name: "P-384"))
|
31
|
+
register(ECDSA.new(-36, "ES512", hash_function: "SHA512", curve_name: "P-521"))
|
32
|
+
register(ECDSA.new(-47, "ES256K", hash_function: "SHA256", curve_name: "secp256k1"))
|
32
33
|
register(RSAPSS.new(-37, "PS256", hash_function: "SHA256", salt_length: 32))
|
33
34
|
register(RSAPSS.new(-38, "PS384", hash_function: "SHA384", salt_length: 48))
|
34
35
|
register(RSAPSS.new(-39, "PS512", hash_function: "SHA512", salt_length: 64))
|
data/lib/cose/algorithm/base.rb
CHANGED
data/lib/cose/algorithm/ecdsa.rb
CHANGED
@@ -2,32 +2,41 @@
|
|
2
2
|
|
3
3
|
require "cose/algorithm/signature_algorithm"
|
4
4
|
require "cose/error"
|
5
|
+
require "cose/key/curve"
|
5
6
|
require "cose/key/ec2"
|
6
7
|
require "openssl"
|
8
|
+
require "openssl/signature_algorithm/ecdsa"
|
7
9
|
|
8
10
|
module COSE
|
9
11
|
module Algorithm
|
10
12
|
class ECDSA < SignatureAlgorithm
|
11
|
-
attr_reader :hash_function
|
13
|
+
attr_reader :hash_function, :curve
|
12
14
|
|
13
|
-
def initialize(*args, hash_function:)
|
15
|
+
def initialize(*args, hash_function:, curve_name:)
|
14
16
|
super(*args)
|
15
17
|
|
16
18
|
@hash_function = hash_function
|
17
|
-
|
18
|
-
|
19
|
-
def compatible_key?(key)
|
20
|
-
to_pkey(key)
|
21
|
-
rescue COSE::Error
|
22
|
-
false
|
19
|
+
@curve = COSE::Key::Curve.by_name(curve_name) || raise("Couldn't find curve with name='#{curve_name}'")
|
23
20
|
end
|
24
21
|
|
25
22
|
private
|
26
23
|
|
27
|
-
def
|
28
|
-
|
24
|
+
def valid_key?(key)
|
25
|
+
cose_key = to_cose_key(key)
|
26
|
+
|
27
|
+
cose_key.is_a?(COSE::Key::EC2) && (!cose_key.alg || cose_key.alg == id)
|
28
|
+
end
|
29
29
|
|
30
|
-
|
30
|
+
def signature_algorithm_class
|
31
|
+
OpenSSL::SignatureAlgorithm::ECDSA
|
32
|
+
end
|
33
|
+
|
34
|
+
def signature_algorithm_parameters
|
35
|
+
if curve
|
36
|
+
super.merge(curve: curve.pkey_name)
|
37
|
+
else
|
38
|
+
super
|
39
|
+
end
|
31
40
|
end
|
32
41
|
|
33
42
|
def to_pkey(key)
|
@@ -40,23 +49,6 @@ module COSE
|
|
40
49
|
raise(COSE::Error, "Incompatible key for algorithm")
|
41
50
|
end
|
42
51
|
end
|
43
|
-
|
44
|
-
# Borrowed from jwt rubygem.
|
45
|
-
# https://github.com/jwt/ruby-jwt/blob/7a6a3f1dbaff806993156d1dff9c217bb2523ff8/lib/jwt/security_utils.rb#L34-L39
|
46
|
-
#
|
47
|
-
# Hopefully this will be provided by openssl rubygem in the future.
|
48
|
-
def in_der(signature, key_length)
|
49
|
-
n = (key_length.to_f / BYTE_LENGTH).ceil
|
50
|
-
|
51
|
-
if signature.size == n * 2
|
52
|
-
r = signature[0..(n - 1)]
|
53
|
-
s = signature[n..-1]
|
54
|
-
|
55
|
-
OpenSSL::ASN1::Sequence.new([r, s].map { |int| OpenSSL::ASN1::Integer.new(OpenSSL::BN.new(int, 2)) }).to_der
|
56
|
-
else
|
57
|
-
signature
|
58
|
-
end
|
59
|
-
end
|
60
52
|
end
|
61
53
|
end
|
62
54
|
end
|
data/lib/cose/algorithm/hmac.rb
CHANGED
@@ -4,6 +4,7 @@ require "cose/algorithm/signature_algorithm"
|
|
4
4
|
require "cose/key/rsa"
|
5
5
|
require "cose/error"
|
6
6
|
require "openssl"
|
7
|
+
require "openssl/signature_algorithm/rsapss"
|
7
8
|
|
8
9
|
module COSE
|
9
10
|
module Algorithm
|
@@ -17,22 +18,14 @@ module COSE
|
|
17
18
|
@salt_length = salt_length
|
18
19
|
end
|
19
20
|
|
20
|
-
def compatible_key?(key)
|
21
|
-
to_pkey(key)
|
22
|
-
rescue COSE::Error
|
23
|
-
false
|
24
|
-
end
|
25
|
-
|
26
21
|
private
|
27
22
|
|
28
|
-
def
|
29
|
-
|
23
|
+
def valid_key?(key)
|
24
|
+
to_cose_key(key).is_a?(COSE::Key::RSA)
|
25
|
+
end
|
30
26
|
|
31
|
-
|
32
|
-
|
33
|
-
else
|
34
|
-
raise(COSE::Error, "Update to openssl gem >= v2.1 to have RSA-PSS support")
|
35
|
-
end
|
27
|
+
def signature_algorithm_class
|
28
|
+
OpenSSL::SignatureAlgorithm::RSAPSS
|
36
29
|
end
|
37
30
|
|
38
31
|
def to_pkey(key)
|
@@ -7,8 +7,55 @@ module COSE
|
|
7
7
|
module Algorithm
|
8
8
|
class SignatureAlgorithm < Base
|
9
9
|
def verify(key, signature, verification_data)
|
10
|
+
compatible_key?(key) || raise(COSE::Error, "Incompatible key for signature verification")
|
10
11
|
valid_signature?(key, signature, verification_data) || raise(COSE::Error, "Signature verification failed")
|
11
12
|
end
|
13
|
+
|
14
|
+
def compatible_key?(key)
|
15
|
+
valid_key?(key) && to_pkey(key)
|
16
|
+
rescue COSE::Error
|
17
|
+
false
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def valid_signature?(key, signature, verification_data)
|
23
|
+
signature_algorithm = signature_algorithm_class.new(**signature_algorithm_parameters)
|
24
|
+
signature_algorithm.verify_key = to_pkey(key)
|
25
|
+
|
26
|
+
begin
|
27
|
+
signature_algorithm.verify(signature, verification_data)
|
28
|
+
rescue OpenSSL::SignatureAlgorithm::Error
|
29
|
+
false
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def signature_algorithm_parameters
|
34
|
+
{ hash_function: hash_function }
|
35
|
+
end
|
36
|
+
|
37
|
+
def to_cose_key(key)
|
38
|
+
case key
|
39
|
+
when COSE::Key::Base
|
40
|
+
key
|
41
|
+
when OpenSSL::PKey::PKey
|
42
|
+
COSE::Key.from_pkey(key)
|
43
|
+
else
|
44
|
+
raise(COSE::Error, "Don't know how to transform #{key.class} to COSE::Key")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def signature_algorithm_class
|
49
|
+
raise NotImplementedError
|
50
|
+
end
|
51
|
+
|
52
|
+
def valid_key?(_key)
|
53
|
+
raise NotImplementedError
|
54
|
+
end
|
55
|
+
|
56
|
+
def to_pkey(_key)
|
57
|
+
raise NotImplementedError
|
58
|
+
end
|
12
59
|
end
|
13
60
|
end
|
14
61
|
end
|
data/lib/cose/key.rb
CHANGED
@@ -8,7 +8,10 @@ require "cose/key/symmetric"
|
|
8
8
|
require "openssl"
|
9
9
|
|
10
10
|
module COSE
|
11
|
-
class
|
11
|
+
class Error < StandardError; end
|
12
|
+
class KeyDeserializationError < Error; end
|
13
|
+
class MalformedKeyError < KeyDeserializationError; end
|
14
|
+
class UnknownKeyType < KeyDeserializationError; end
|
12
15
|
|
13
16
|
module Key
|
14
17
|
def self.serialize(pkey)
|
@@ -27,7 +30,7 @@ module COSE
|
|
27
30
|
end
|
28
31
|
|
29
32
|
def self.deserialize(data)
|
30
|
-
map =
|
33
|
+
map = cbor_decode(data)
|
31
34
|
|
32
35
|
case map[Base::LABEL_KTY]
|
33
36
|
when COSE::Key::OKP::KTY_OKP
|
@@ -39,10 +42,16 @@ module COSE
|
|
39
42
|
when COSE::Key::Symmetric::KTY_SYMMETRIC
|
40
43
|
COSE::Key::Symmetric.from_map(map)
|
41
44
|
when nil
|
42
|
-
raise UnknownKeyType, "Missing required key type kty label"
|
45
|
+
raise COSE::UnknownKeyType, "Missing required key type kty label"
|
43
46
|
else
|
44
|
-
raise UnknownKeyType, "Unsupported or unknown key type #{map[Base::LABEL_KTY]}"
|
47
|
+
raise COSE::UnknownKeyType, "Unsupported or unknown key type #{map[Base::LABEL_KTY]}"
|
45
48
|
end
|
46
49
|
end
|
50
|
+
|
51
|
+
def self.cbor_decode(data)
|
52
|
+
CBOR.decode(data)
|
53
|
+
rescue CBOR::MalformedFormatError, EOFError, FloatDomainError, RegexpError, TypeError, URI::InvalidURIError
|
54
|
+
raise COSE::MalformedKeyError, "Malformed CBOR key input"
|
55
|
+
end
|
47
56
|
end
|
48
57
|
end
|
data/lib/cose/key/base.rb
CHANGED
data/lib/cose/key/curve.rb
CHANGED
data/lib/cose/key/curve_key.rb
CHANGED
@@ -20,7 +20,7 @@ module COSE
|
|
20
20
|
}
|
21
21
|
end
|
22
22
|
|
23
|
-
def initialize(crv:, x: nil, d: nil, **keyword_arguments) # rubocop:disable Naming/
|
23
|
+
def initialize(crv:, x: nil, d: nil, **keyword_arguments) # rubocop:disable Naming/MethodParameterName
|
24
24
|
super(**keyword_arguments)
|
25
25
|
|
26
26
|
if !crv
|
@@ -35,13 +35,11 @@ module COSE
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def map
|
38
|
-
|
38
|
+
super.merge(
|
39
39
|
LABEL_CRV => crv,
|
40
40
|
LABEL_X => x,
|
41
41
|
LABEL_D => d
|
42
|
-
)
|
43
|
-
|
44
|
-
map.reject { |_k, v| v.nil? }
|
42
|
+
).compact
|
45
43
|
end
|
46
44
|
end
|
47
45
|
end
|
data/lib/cose/key/ec2.rb
CHANGED
@@ -48,7 +48,7 @@ module COSE
|
|
48
48
|
|
49
49
|
attr_reader :y
|
50
50
|
|
51
|
-
def initialize(y: nil, **keyword_arguments) # rubocop:disable Naming/
|
51
|
+
def initialize(y: nil, **keyword_arguments) # rubocop:disable Naming/MethodParameterName
|
52
52
|
if (!y || !keyword_arguments[:x]) && !keyword_arguments[:d]
|
53
53
|
raise ArgumentError, "Both x and y are required if d is missing"
|
54
54
|
else
|
@@ -59,12 +59,10 @@ module COSE
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def map
|
62
|
-
|
62
|
+
super.merge(
|
63
63
|
Base::LABEL_KTY => KTY_EC2,
|
64
64
|
LABEL_Y => y,
|
65
|
-
)
|
66
|
-
|
67
|
-
map.reject { |_k, v| v.nil? }
|
65
|
+
).compact
|
68
66
|
end
|
69
67
|
|
70
68
|
def to_pkey
|
data/lib/cose/key/rsa.rb
CHANGED
@@ -42,12 +42,12 @@ module COSE
|
|
42
42
|
)
|
43
43
|
end
|
44
44
|
|
45
|
-
new(attributes)
|
45
|
+
new(**attributes)
|
46
46
|
end
|
47
47
|
|
48
48
|
attr_reader :n, :e, :d, :p, :q, :dp, :dq, :qinv
|
49
49
|
|
50
|
-
def initialize(n:, e:, d: nil, p: nil, q: nil, dp: nil, dq: nil, qinv: nil, **keyword_arguments) # rubocop:disable Naming/
|
50
|
+
def initialize(n:, e:, d: nil, p: nil, q: nil, dp: nil, dq: nil, qinv: nil, **keyword_arguments) # rubocop:disable Naming/MethodParameterName
|
51
51
|
super(**keyword_arguments)
|
52
52
|
|
53
53
|
if !n
|
@@ -74,7 +74,7 @@ module COSE
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def map
|
77
|
-
|
77
|
+
super.merge(
|
78
78
|
Base::LABEL_KTY => KTY_RSA,
|
79
79
|
LABEL_N => n,
|
80
80
|
LABEL_E => e,
|
@@ -84,9 +84,7 @@ module COSE
|
|
84
84
|
LABEL_DP => dp,
|
85
85
|
LABEL_DQ => dq,
|
86
86
|
LABEL_QINV => qinv
|
87
|
-
)
|
88
|
-
|
89
|
-
map.reject { |_k, v| v.nil? }
|
87
|
+
).compact
|
90
88
|
end
|
91
89
|
|
92
90
|
def to_pkey
|
data/lib/cose/key/symmetric.rb
CHANGED
data/lib/cose/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gonzalo Rodriguez
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-07-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cbor
|
@@ -25,6 +25,20 @@ dependencies:
|
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 0.5.9
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: openssl-signature_algorithm
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '1.0'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '1.0'
|
28
42
|
- !ruby/object:Gem::Dependency
|
29
43
|
name: appraisal
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -63,30 +77,30 @@ dependencies:
|
|
63
77
|
name: byebug
|
64
78
|
requirement: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- - "
|
80
|
+
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
82
|
+
version: '11.0'
|
69
83
|
type: :development
|
70
84
|
prerelease: false
|
71
85
|
version_requirements: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- - "
|
87
|
+
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
89
|
+
version: '11.0'
|
76
90
|
- !ruby/object:Gem::Dependency
|
77
91
|
name: rake
|
78
92
|
requirement: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
96
|
+
version: '13.0'
|
83
97
|
type: :development
|
84
98
|
prerelease: false
|
85
99
|
version_requirements: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - "~>"
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
103
|
+
version: '13.0'
|
90
104
|
- !ruby/object:Gem::Dependency
|
91
105
|
name: rspec
|
92
106
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,14 +121,14 @@ dependencies:
|
|
107
121
|
requirements:
|
108
122
|
- - '='
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.
|
124
|
+
version: 0.80.1
|
111
125
|
type: :development
|
112
126
|
prerelease: false
|
113
127
|
version_requirements: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - '='
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
131
|
+
version: 0.80.1
|
118
132
|
- !ruby/object:Gem::Dependency
|
119
133
|
name: rubocop-performance
|
120
134
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,6 +168,7 @@ files:
|
|
154
168
|
- cose.gemspec
|
155
169
|
- gemfiles/openssl_2_0.gemfile
|
156
170
|
- gemfiles/openssl_2_1.gemfile
|
171
|
+
- gemfiles/openssl_2_2.gemfile
|
157
172
|
- gemfiles/openssl_default.gemfile
|
158
173
|
- gemfiles/openssl_head.gemfile
|
159
174
|
- lib/cose.rb
|
@@ -198,14 +213,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
198
213
|
requirements:
|
199
214
|
- - ">="
|
200
215
|
- !ruby/object:Gem::Version
|
201
|
-
version: '2.
|
216
|
+
version: '2.4'
|
202
217
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
203
218
|
requirements:
|
204
219
|
- - ">="
|
205
220
|
- !ruby/object:Gem::Version
|
206
221
|
version: '0'
|
207
222
|
requirements: []
|
208
|
-
rubygems_version: 3.
|
223
|
+
rubygems_version: 3.1.4
|
209
224
|
signing_key:
|
210
225
|
specification_version: 4
|
211
226
|
summary: Ruby implementation of RFC 8152 CBOR Object Signing and Encryption (COSE)
|