File tree 1 file changed +16
-5
lines changed
1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- set -euxo pipefail
3
+ set -Eeuxo pipefail
4
4
5
5
/etc/init.d/pcscd start
6
6
@@ -13,7 +13,18 @@ echo 12345678 > admin-pin
13
13
echo 123456 > user-pin
14
14
oct admin --card 0000:00000000 --admin-pin admin-pin generate --user-pin user-pin --output /tmp/no-need-for-this --userid ' No need for that' curve25519
15
15
16
- age-plugin-openpgp-card | tee identity.txt
17
- grep -oh " age1.*" identity.txt > recipients.txt
18
- echo I like strawberries | rage -R recipients.txt -a | tee encrypted.age
19
- rage -d -i identity.txt < encrypted.age
16
+ function roundtrip {
17
+ age-plugin-openpgp-card | tee identity.txt
18
+ grep -oh " age1.*" identity.txt > recipients.txt
19
+ echo I like strawberries > message.txt
20
+ < message.txt rage -R recipients.txt -a | tee encrypted.age
21
+ rage -d -i identity.txt < encrypted.age > decrypted.txt
22
+ cmp --silent message.txt decrypted.txt
23
+ }
24
+
25
+ # test encryption/decryption without KDF
26
+ roundtrip
27
+
28
+ # test encryption/decryption with KDF
29
+ oct system kdf-setup --card 0000:00000000
30
+ roundtrip
You can’t perform that action at this time.
0 commit comments