jose 1.1.3 → 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/.github/workflows/ci.yml +27 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +11 -0
- data/Gemfile +9 -2
- data/LICENSE.md +22 -373
- data/README.md +2 -2
- data/Rakefile +1 -0
- data/jose.gemspec +6 -5
- data/lib/jose/jwa/curve25519_rbnacl.rb +0 -4
- data/lib/jose/jwa/ed25519_rbnacl.rb +18 -1
- data/lib/jose/jwa/pkcs1.rb +2 -2
- data/lib/jose/jwa/xchacha20poly1305.rb +61 -0
- data/lib/jose/jwa/xchacha20poly1305_rbnacl.rb +35 -0
- data/lib/jose/jwa/xchacha20poly1305_unsupported.rb +16 -0
- data/lib/jose/jwa.rb +9 -4
- data/lib/jose/jwe/alg.rb +2 -0
- data/lib/jose/jwe/alg_aes_gcm_kw.rb +1 -1
- data/lib/jose/jwe/alg_c20p_kw.rb +100 -0
- data/lib/jose/jwe/alg_xc20p_kw.rb +86 -0
- data/lib/jose/jwe/enc.rb +2 -0
- data/lib/jose/jwe/enc_c20p.rb +62 -0
- data/lib/jose/jwe/enc_xc20p.rb +49 -0
- data/lib/jose/jwe.rb +8 -0
- data/lib/jose/jwk/kty_ec.rb +20 -5
- data/lib/jose/jwk/kty_rsa.rb +46 -32
- data/lib/jose/jwk/openssh_key.rb +0 -1
- data/lib/jose/jwk/set.rb +3 -3
- data/lib/jose/jwk.rb +1 -1
- data/lib/jose/version.rb +1 -1
- data/lib/jose.rb +23 -3
- metadata +35 -15
- data/.travis.yml +0 -18
data/lib/jose.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'jose/version'
|
2
2
|
|
3
3
|
require 'base64'
|
4
|
-
require '
|
4
|
+
require 'immutable/hash'
|
5
5
|
require 'json'
|
6
6
|
require 'openssl'
|
7
7
|
require 'securerandom'
|
@@ -28,8 +28,8 @@ module JOSE
|
|
28
28
|
# @!visibility private
|
29
29
|
MUTEX = Mutex.new
|
30
30
|
|
31
|
-
# Immutable Map structure based on `
|
32
|
-
class Map <
|
31
|
+
# Immutable Map structure based on `Immutable::Hash`.
|
32
|
+
class Map < Immutable::Hash; end
|
33
33
|
|
34
34
|
@__crypto_fallback__ = ENV['JOSE_CRYPTO_FALLBACK'] ? true : false
|
35
35
|
@__unsecured_signing__ = ENV['JOSE_UNSECURED_SIGNING'] ? true : false
|
@@ -148,11 +148,31 @@ module JOSE
|
|
148
148
|
return Base64.strict_encode64(binary).tr('+/', '-_').delete('=')
|
149
149
|
end
|
150
150
|
|
151
|
+
# Gets the current XChaCha20-Poly1305 module used by {JOSE::JWA::XChaCha20Poly1305 JOSE::JWA::XChaCha20Poly1305}, see {.xchacha20poly1305_module=} for default.
|
152
|
+
# @return [Module]
|
153
|
+
def self.xchacha20poly1305_module
|
154
|
+
return JOSE::JWA::XChaCha20Poly1305.__implementation__
|
155
|
+
end
|
156
|
+
|
157
|
+
# Sets the current XChaCha20Poly1305 module used by {JOSE::JWA::XChaCha20Poly1305 JOSE::JWA::XChaCha20Poly1305}.
|
158
|
+
#
|
159
|
+
# Currently supported XChaCha20Poly1305 modules (first found is used as default):
|
160
|
+
#
|
161
|
+
# * {https://github.com/cryptosphere/rbnacl `RbNaCl`}
|
162
|
+
#
|
163
|
+
# Additional modules that implement the functions specified in {JOSE::JWA::XChaCha20Poly1305 JOSE::JWA::XChaCha20Poly1305} may also be used.
|
164
|
+
# @param [Module] mod
|
165
|
+
# @return [Module]
|
166
|
+
def self.xchacha20poly1305_module=(mod)
|
167
|
+
JOSE::JWA::XChaCha20Poly1305.__implementation__ = mod
|
168
|
+
end
|
169
|
+
|
151
170
|
private
|
152
171
|
|
153
172
|
def self.__config_change__
|
154
173
|
JOSE::JWA::Curve25519.__config_change__
|
155
174
|
JOSE::JWA::Curve448.__config_change__
|
175
|
+
JOSE::JWA::XChaCha20Poly1305.__config_change__
|
156
176
|
end
|
157
177
|
|
158
178
|
def self.sort_maps(term)
|
metadata
CHANGED
@@ -1,17 +1,31 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Bennett
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: base64
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: immutable-ruby
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
31
|
- - ">="
|
@@ -30,28 +44,28 @@ dependencies:
|
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
47
|
+
version: '2.5'
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
54
|
+
version: '2.5'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
61
|
+
version: '13.1'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
68
|
+
version: '13.1'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: minitest
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,7 +95,7 @@ dependencies:
|
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
|
-
name: rbnacl
|
98
|
+
name: rbnacl
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - ">="
|
@@ -130,10 +144,10 @@ extensions: []
|
|
130
144
|
extra_rdoc_files: []
|
131
145
|
files:
|
132
146
|
- ".editorconfig"
|
147
|
+
- ".github/workflows/ci.yml"
|
133
148
|
- ".gitignore"
|
134
149
|
- ".ruby-gemset"
|
135
150
|
- ".ruby-version"
|
136
|
-
- ".travis.yml"
|
137
151
|
- ".yardopts"
|
138
152
|
- CHANGELOG.md
|
139
153
|
- CODE_OF_CONDUCT.md
|
@@ -173,17 +187,24 @@ files:
|
|
173
187
|
- lib/jose/jwa/x25519_cryptorb.rb
|
174
188
|
- lib/jose/jwa/x25519_rbnacl.rb
|
175
189
|
- lib/jose/jwa/x448.rb
|
190
|
+
- lib/jose/jwa/xchacha20poly1305.rb
|
191
|
+
- lib/jose/jwa/xchacha20poly1305_rbnacl.rb
|
192
|
+
- lib/jose/jwa/xchacha20poly1305_unsupported.rb
|
176
193
|
- lib/jose/jwe.rb
|
177
194
|
- lib/jose/jwe/alg.rb
|
178
195
|
- lib/jose/jwe/alg_aes_gcm_kw.rb
|
179
196
|
- lib/jose/jwe/alg_aes_kw.rb
|
197
|
+
- lib/jose/jwe/alg_c20p_kw.rb
|
180
198
|
- lib/jose/jwe/alg_dir.rb
|
181
199
|
- lib/jose/jwe/alg_ecdh_es.rb
|
182
200
|
- lib/jose/jwe/alg_pbes2.rb
|
183
201
|
- lib/jose/jwe/alg_rsa.rb
|
202
|
+
- lib/jose/jwe/alg_xc20p_kw.rb
|
184
203
|
- lib/jose/jwe/enc.rb
|
185
204
|
- lib/jose/jwe/enc_aes_cbc_hmac.rb
|
186
205
|
- lib/jose/jwe/enc_aes_gcm.rb
|
206
|
+
- lib/jose/jwe/enc_c20p.rb
|
207
|
+
- lib/jose/jwe/enc_xc20p.rb
|
187
208
|
- lib/jose/jwe/zip.rb
|
188
209
|
- lib/jose/jwe/zip_def.rb
|
189
210
|
- lib/jose/jwk.rb
|
@@ -213,9 +234,9 @@ files:
|
|
213
234
|
- lib/jose/version.rb
|
214
235
|
homepage: https://github.com/potatosalad/ruby-jose
|
215
236
|
licenses:
|
216
|
-
-
|
237
|
+
- MIT
|
217
238
|
metadata: {}
|
218
|
-
post_install_message:
|
239
|
+
post_install_message:
|
219
240
|
rdoc_options: []
|
220
241
|
require_paths:
|
221
242
|
- lib
|
@@ -230,9 +251,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
251
|
- !ruby/object:Gem::Version
|
231
252
|
version: '0'
|
232
253
|
requirements: []
|
233
|
-
|
234
|
-
|
235
|
-
signing_key:
|
254
|
+
rubygems_version: 3.5.3
|
255
|
+
signing_key:
|
236
256
|
specification_version: 4
|
237
257
|
summary: JSON Object Signing and Encryption
|
238
258
|
test_files: []
|
data/.travis.yml
DELETED