Skip to content

Commit 01712f2

Browse files
committed
docs: updating docs for pkcs #1 v2.2
1 parent 43e41a1 commit 01712f2

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

docs/src/examples.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import Random
55
using ToyPublicKeys
66
Random.seed!(42)
77
private_key, public_key = ToyPublicKeys.generate_rsa_key_pair(ToyPublicKeys.pkcs1_v1_5, 2048)
8-
msg = "Super secret message!"
8+
msg = Vector{UInt8}("Super secret message!")
9+
910
println(msg)
10-
encrypted = ToyPublicKeys.encrypt(ToyPublicKeys.pkcs1_v1_5, msg, public_key)
11+
encrypted = ToyPublicKeys.encrypt(msg, public_key)
1112
println(encrypted)
12-
decrypted = ToyPublicKeys.decrypt(ToyPublicKeys.pkcs1_v1_5, encrypted, private_key)
13+
decrypted = ToyPublicKeys.decrypt(encrypted, private_key)
1314
println(decrypted)
1415
```
1516
## Signatures and their verification
@@ -18,11 +19,11 @@ import Random
1819
using ToyPublicKeys
1920
Random.seed!(42)
2021
private_key, public_key = ToyPublicKeys.generate_rsa_key_pair(ToyPublicKeys.pkcs1_v1_5, 2048)
21-
msg = "Super authentic message!"
22+
msg = Vector{UInt8}("Super authentic message!")
2223
println("Currently this feature is disabled")
23-
#println(msg)
24-
#signature = ToyPublicKeys.sign(ToyPublicKeys.pkcs1_v1_5, msg, private_key)
25-
#println(signature)
26-
#authentic = ToyPublicKeys.verify_signature(ToyPublicKeys.pkcs1_v1_5, msg, signature, public_key)
27-
#println(authentic)
24+
println(msg)
25+
signature = ToyPublicKeys.sign(msg, private_key)
26+
println(signature)
27+
authentic = ToyPublicKeys.verify_signature(msg, signature, public_key)
28+
println(authentic)
2829
```

0 commit comments

Comments
 (0)