jwk-tool 0.0.3 → 0.0.4
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 +4 -4
- data/README.md +5 -4
- data/jwk-tool.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8783a1a354a7199f27b2c6d57d9162246e21b34
|
4
|
+
data.tar.gz: 8d4a160d20c924c1c110fe6e6f3b0ef6ce4954e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 432e34438c4ab7c52d9ec03f3260c346a9b17d38e99f06963b6ec09a5ec03b844afe842d60eb13b274cf1d0928eb5b4609ed4de952a6ff47c244698dcd38694a
|
7
|
+
data.tar.gz: fba24d9bd4299ee7c16577acc70d447c6aa7d02c6d44749d7ddb972c4692246e5a041fb5140aff0a1993f72e6462830887a22c6a50e904092720d06323ed237e
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ To use the keys as JSON Web Key (JSON::JWK) defined in json-jwk, just read files
|
|
17
17
|
|
18
18
|
An encryption example at sender node using public key.
|
19
19
|
|
20
|
-
|
20
|
+
```ruby
|
21
21
|
require 'json/jwk'
|
22
22
|
# read public key from file
|
23
23
|
jwk_pub = JSON::JWK.new(JSON.parse(open('hoge.pub').read))
|
@@ -31,15 +31,16 @@ jwe.alg = :RSA1_5
|
|
31
31
|
jwe.encrypt!(jwk_pub.to_key)
|
32
32
|
# output the result in JSON format
|
33
33
|
json = jwe.as_json.to_json
|
34
|
-
|
34
|
+
```
|
35
35
|
|
36
36
|
A decryption example at receiver node using private key.
|
37
37
|
|
38
|
-
|
38
|
+
```ruby
|
39
|
+
require 'json/jwk'
|
39
40
|
# read private key from file
|
40
41
|
jwk = JSON::JWK.new(JSON.parse(open('hoge').read))
|
41
42
|
# decrypt JSON format cipher data
|
42
43
|
jwe_dec = JSON::JWE.decode_json_serialized(JSON.parse(json), jwk.to_key)
|
43
44
|
# obtain the original plain text
|
44
45
|
jwe_dec.plain_text
|
45
|
-
|
46
|
+
```
|
data/jwk-tool.gemspec
CHANGED