2022-06-25 22:43:28 +02:00
#shellcheck shell=sh
set -eu
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
CRED_FILE = " ${ SHELLSPEC_TMPBASE } /credentials "
DUBP_FILE = " ${ SHELLSPEC_TMPBASE } /mnemonic "
2022-09-23 11:33:13 +02:00
EWIF_FILE = " ${ SHELLSPEC_TMPBASE } /username.ewif "
2022-09-27 16:33:07 +02:00
JWK_FILE = " ${ SHELLSPEC_TMPBASE } /username.jwk "
2022-09-23 11:33:13 +02:00
NACL_FILE = " ${ SHELLSPEC_TMPBASE } /username.nacl "
2022-10-01 03:13:35 +02:00
P2P_FILE = " ${ SHELLSPEC_TMPBASE } /username.p2p "
2022-09-23 11:33:13 +02:00
PEM_FILE = " ${ SHELLSPEC_TMPBASE } /username.pem "
PUBSEC_FILE = " ${ SHELLSPEC_TMPBASE } /username.pubsec "
SEED_FILE = " ${ SHELLSPEC_TMPBASE } /username.seed "
SSB_FILE = " ${ SHELLSPEC_TMPBASE } /username.ssb "
WIF_FILE = " ${ SHELLSPEC_TMPBASE } /username.wif "
2022-09-12 12:22:48 +02:00
gpg( ) {
2022-09-18 13:55:41 +02:00
GNUPGHOME = " ${ SHELLSPEC_TMPBASE } " command gpg " $@ "
2022-09-12 12:22:48 +02:00
}
2022-06-25 22:43:28 +02:00
keygen( ) {
2022-10-08 05:14:20 +02:00
if [ -x ./keygen ] ; then
GNUPGHOME = " ${ SHELLSPEC_TMPBASE } " ./keygen " $@ "
2022-06-25 22:43:28 +02:00
elif [ -x ./bin/keygen ] ; then
2022-09-18 13:55:41 +02:00
GNUPGHOME = " ${ SHELLSPEC_TMPBASE } " ./bin/keygen " $@ "
2022-06-25 22:43:28 +02:00
else
2022-09-18 13:55:41 +02:00
GNUPGHOME = " ${ SHELLSPEC_TMPBASE } " command keygen " $@ "
2022-06-25 22:43:28 +02:00
fi
}
Describe 'Dependency'
2022-08-31 18:01:15 +02:00
Describe 'pinentry:'
It 'is available'
When run pinentry --help
2022-09-12 12:22:48 +02:00
The output should include 'pinentry'
2022-08-31 18:01:15 +02:00
The status should be success
The stderr should be present
End
End
2022-06-25 22:43:28 +02:00
End
Describe 'keygen'
Describe '--help:'
It 'prints help'
When run keygen --help
The output should include 'usage:'
The status should be success
The stderr should equal ""
End
End
Describe '--version:'
It 'prints version'
When run keygen --version
2022-10-08 05:14:20 +02:00
The output should include 'v0.1.0'
2022-06-25 22:43:28 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe '-p password username:'
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
It 'prints base58 public key for user "username" and password "password"'
2022-10-08 05:14:20 +02:00
When run keygen -p password username
2022-09-12 14:19:05 +02:00
The output should include '4YLU1xQ9jzb7LzC6d91VZrYTEKS9N2j93Nnvcee6wxZG'
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe '-p password -s username:'
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
It 'prints base58 secret key for user "username" and password "password"'
2022-10-08 05:14:20 +02:00
When run keygen -p password -s username
2022-09-12 14:19:05 +02:00
The output should include 'K5heSX4xGUPtRbxcZh6zbgaKbDv8FeVc9JuSNWtUs7C1oGNKqv7kQJ3DHdouTPzoW4duKKnuLQK8LbHKfN9fkjC'
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe '-k -p password username:'
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
It 'prints base58 public and secret keys for user "username" and password "password"'
2022-10-08 05:14:20 +02:00
When run keygen -k -p password username
2022-09-12 14:19:05 +02:00
The output should include '4YLU1xQ9jzb7LzC6d91VZrYTEKS9N2j93Nnvcee6wxZG'
The output should include 'K5heSX4xGUPtRbxcZh6zbgaKbDv8FeVc9JuSNWtUs7C1oGNKqv7kQJ3DHdouTPzoW4duKKnuLQK8LbHKfN9fkjC'
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe '-k -p password -t b36mf username:'
It 'prints base36 multiformat public and secret keys for user "username" and password "password"'
When run keygen -k -p password -t b36mf username
The output should include 'k51qzi5uqu5dhhsbw068pust1xf763zdmyu2mb8rf6ewu2oz3in3a2g6pgtqy3'
The output should include 'kmxn88f5mep5chc4tc002gyhtl9vgiluellgje285y2hn5a5kjdvqge7oeb0jryupt1q09w48h2nxg0ofcjco0wjwa824v3p9tvw6us9gdkb'
2022-09-12 14:19:05 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe '-k -p password -t b58mf username:'
It 'prints base58 multiformat public and secret keys for user "username" and password "password"'
When run keygen -k -p password -t b58mf username
The output should include 'z5AanNVJCxnJNiidpTZyuYzkQcrHRCyhxMV7Z4KYDV1MYy2ETMrEbUn'
The output should include 'z4gg7xjCuszBpvNVcDAmNYVNrZxwXfDDQGoAShWmmQBkWRzZbR8A4ZBpkk4iTj3YSLBxvGZRf1AjCyGDdczhs7tshCsbFK4e'
2022-10-01 03:13:35 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe '-k -p password -t b58mh username:'
It 'prints base58 multihash public and secret keys for user "username" and password "password"'
When run keygen -k -p password -t b58mh username
The output should include '12D3KooWDMhdm5yrvtrbkshXFjkqLedHieUnPioczy9wzdnzquHC'
The output should include '23jhTarm17VAHUwPkHD2Kv5sPfuQrsXSZUzKUrRkP2oP8bgnLjVExhG4AVoayCLxbXN4g2pjVG5qiJRucUtogbj7zGapz'
2022-10-01 03:13:35 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe '-k -p password -t b64mh username:'
It 'prints base64 multihash public and secret keys for user "username" and password "password"'
When run keygen -k -p password -t b64mh username
The output should include 'ACQIARIgNJoTbvcP+m51+XwxrmWqHaOpI1ZD0USwLjqAmV8Boas='
The output should include 'CAESQA+XqCWjRqCjNe9oU3QA796bEH+T+rxgyPQ/EkXvE2MvNJoTbvcP+m51+XwxrmWqHaOpI1ZD0USwLjqAmV8Boas='
2022-09-23 11:33:13 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe '-k -p password -t base58 username:'
It 'prints base58 public and secret keys for user "username" and password "password"'
When run keygen -k -p password -t base58 username
The output should include '4YLU1xQ9jzb7LzC6d91VZrYTEKS9N2j93Nnvcee6wxZG'
The output should include 'K5heSX4xGUPtRbxcZh6zbgaKbDv8FeVc9JuSNWtUs7C1oGNKqv7kQJ3DHdouTPzoW4duKKnuLQK8LbHKfN9fkjC'
2022-06-25 22:43:28 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe '-k -p password -t base64 username:'
It 'prints base64 public and secret keys for user "username" and password "password"'
When run keygen -k -p password -t base64 username
The output should include 'NJoTbvcP+m51+XwxrmWqHaOpI1ZD0USwLjqAmV8Boas='
The output should include 'D5eoJaNGoKM172hTdADv3psQf5P6vGDI9D8SRe8TYy80mhNu9w/6bnX5fDGuZaodo6kjVkPRRLAuOoCZXwGhqw=='
2022-09-18 13:55:41 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe '-k -p password -t duniter username:'
It 'prints duniter public and secret keys for user "username" and password "password"'
When run keygen -k -p password -t duniter username
The output should include '4YLU1xQ9jzb7LzC6d91VZrYTEKS9N2j93Nnvcee6wxZG'
The output should include 'K5heSX4xGUPtRbxcZh6zbgaKbDv8FeVc9JuSNWtUs7C1oGNKqv7kQJ3DHdouTPzoW4duKKnuLQK8LbHKfN9fkjC'
2022-06-25 22:43:28 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe '-k -p password -t ipfs username:'
It 'prints ipfs public and secret keys for user "username" and password "password"'
When run keygen -k -p password -t ipfs username
The output should include '12D3KooWDMhdm5yrvtrbkshXFjkqLedHieUnPioczy9wzdnzquHC'
The output should include 'CAESQA+XqCWjRqCjNe9oU3QA796bEH+T+rxgyPQ/EkXvE2MvNJoTbvcP+m51+XwxrmWqHaOpI1ZD0USwLjqAmV8Boas='
2022-06-25 22:43:28 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe '-k -p password -t jwk username:'
It 'prints jwk public and secret keys for user "username" and password "password"'
When run keygen -k -p password -t jwk username
The output should include '{"crv":"Ed25519","kty":"OKP","x":"NJoTbvcP-m51-XwxrmWqHaOpI1ZD0USwLjqAmV8Boas"}'
The output should include '{"crv":"Ed25519","d":"D5eoJaNGoKM172hTdADv3psQf5P6vGDI9D8SRe8TYy8","kty":"OKP","x":"NJoTbvcP-m51-XwxrmWqHaOpI1ZD0USwLjqAmV8Boas"}'
2022-09-27 16:33:07 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe '-k -m "tongue cute mail ...":'
It 'prints base58 public and secret keys for mnemonic "tongue cute mail ..."'
When run keygen -k -m "tongue cute mail fossil great frozen same social weasel impact brush kind"
The output should include '732SSfuwjB7jkt9th1zerGhphs6nknaCBCTozxUcPWPU'
The output should include '4NHNg9KSp81nXAN4Gmwx4EZ9bCdahnJ9jozJa1cGj9oDvzx9kCtNSvasqTZVm6VJXBQxyakZ5uZnj8AS6g87kK3x'
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe " -i ${ CRED_FILE } -k -v: "
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
printf 'username\npassword\n' > " ${ CRED_FILE } "
2022-10-08 05:14:20 +02:00
It 'prints base58 public and secret keys for username and password read from credentials file"'
When run keygen -i " ${ CRED_FILE } " -k -v
The output should include '4YLU1xQ9jzb7LzC6d91VZrYTEKS9N2j93Nnvcee6wxZG'
The output should include 'K5heSX4xGUPtRbxcZh6zbgaKbDv8FeVc9JuSNWtUs7C1oGNKqv7kQJ3DHdouTPzoW4duKKnuLQK8LbHKfN9fkjC'
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
The status should be success
The stderr should include 'input file format detected: credentials'
End
rm -f " ${ CRED_FILE } "
End
2022-10-08 05:14:20 +02:00
Describe " -i ${ DUBP_FILE } -k -v: "
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
printf 'tongue cute mail fossil great frozen same social weasel impact brush kind\n' > " ${ DUBP_FILE } "
2022-10-08 05:14:20 +02:00
It 'prints base58 public and secret keys for mnemonic read from dubp file"'
When run keygen -i " ${ DUBP_FILE } " -k -v
The output should include '732SSfuwjB7jkt9th1zerGhphs6nknaCBCTozxUcPWPU'
The output should include '4NHNg9KSp81nXAN4Gmwx4EZ9bCdahnJ9jozJa1cGj9oDvzx9kCtNSvasqTZVm6VJXBQxyakZ5uZnj8AS6g87kK3x'
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
The status should be success
The stderr should include 'input file format detected: mnemonic'
End
rm -f " ${ DUBP_FILE } "
End
2022-10-08 05:14:20 +02:00
Describe " -f jwk -o ${ JWK_FILE } -p password username: "
2022-09-27 16:33:07 +02:00
rm -f " ${ JWK_FILE } "
It 'writes secret key to a JWK file for user "username" and password "password"'
2022-10-08 05:14:20 +02:00
When run keygen -f jwk -o " ${ JWK_FILE } " -p password username
2022-09-27 16:33:07 +02:00
The path " ${ JWK_FILE } " should exist
The contents of file " ${ JWK_FILE } " should include '{"crv":"Ed25519","d":"D5eoJaNGoKM172hTdADv3psQf5P6vGDI9D8SRe8TYy8","kty":"OKP","x":"NJoTbvcP-m51-XwxrmWqHaOpI1ZD0USwLjqAmV8Boas"}'
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe " -i ${ JWK_FILE } -k -v: "
It 'prints base58 public and secret keys for ed25519 key read from JWK file"'
When run keygen -i " ${ JWK_FILE } " -k -v
The output should include '4YLU1xQ9jzb7LzC6d91VZrYTEKS9N2j93Nnvcee6wxZG'
The output should include 'K5heSX4xGUPtRbxcZh6zbgaKbDv8FeVc9JuSNWtUs7C1oGNKqv7kQJ3DHdouTPzoW4duKKnuLQK8LbHKfN9fkjC'
2022-09-27 16:33:07 +02:00
The status should be success
The stderr should include 'input file format detected: jwk'
End
rm -f " ${ JWK_FILE } "
End
2022-10-08 05:14:20 +02:00
Describe " -f nacl -o ${ NACL_FILE } -p password username: "
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
rm -f " ${ NACL_FILE } "
It 'writes secret key to a libnacl file for user "username" and password "password"'
2022-10-08 05:14:20 +02:00
When run keygen -f nacl -o " ${ NACL_FILE } " -p password username
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
The path " ${ NACL_FILE } " should exist
The contents of file " ${ NACL_FILE } " should include '{"priv": "0f97a825a346a0a335ef68537400efde9b107f93fabc60c8f43f1245ef13632f349a136ef70ffa6e75f97c31ae65aa1da3a9235643d144b02e3a80995f01a1ab", "verify": "349a136ef70ffa6e75f97c31ae65aa1da3a9235643d144b02e3a80995f01a1ab", "sign": "0f97a825a346a0a335ef68537400efde9b107f93fabc60c8f43f1245ef13632f"}'
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe " -i ${ NACL_FILE } -k -v: "
It 'prints base58 public and secret keys for ed25519 key read from libnacl file"'
When run keygen -i " ${ NACL_FILE } " -k -v
The output should include '4YLU1xQ9jzb7LzC6d91VZrYTEKS9N2j93Nnvcee6wxZG'
The output should include 'K5heSX4xGUPtRbxcZh6zbgaKbDv8FeVc9JuSNWtUs7C1oGNKqv7kQJ3DHdouTPzoW4duKKnuLQK8LbHKfN9fkjC'
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
The status should be success
The stderr should include 'input file format detected: nacl'
End
rm -f " ${ NACL_FILE } "
End
2022-10-08 05:14:20 +02:00
Describe " -f ewif -o ${ EWIF_FILE } -p password username: "
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
rm -f " ${ EWIF_FILE } "
2022-10-08 05:14:20 +02:00
It 'writes encrypted secret key to an EWIF file for user "username" and password "password"'
When run keygen -f ewif -o " ${ EWIF_FILE } " -p password username
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
The path " ${ EWIF_FILE } " should exist
The contents of file " ${ EWIF_FILE } " should include 'Type: EWIF'
The contents of file " ${ EWIF_FILE } " should include 'Version: 1'
The contents of file " ${ EWIF_FILE } " should include 'Data: 2w6iPHHjrfGT3HWvNV1cw3ZpGXAAQtfYzRxDXUkyW2y5WBorLtDUY'
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe " -i ${ EWIF_FILE } -k -p password -v: "
It 'prints base58 public and secret keys for ed25519 key read from EWIF file encrypted with password "password"'
When run keygen -i " ${ EWIF_FILE } " -k -p password -v username
The output should include '4YLU1xQ9jzb7LzC6d91VZrYTEKS9N2j93Nnvcee6wxZG'
The output should include 'K5heSX4xGUPtRbxcZh6zbgaKbDv8FeVc9JuSNWtUs7C1oGNKqv7kQJ3DHdouTPzoW4duKKnuLQK8LbHKfN9fkjC'
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
The status should be success
The stderr should include 'input file format detected: ewif'
End
rm -f " ${ EWIF_FILE } "
End
2022-10-08 05:14:20 +02:00
Describe " -o ${ PEM_FILE } -p password username: "
2022-09-18 13:55:41 +02:00
rm -f " ${ PEM_FILE } "
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
It 'writes pkcs8 secret key to a pem file for user "username" and password "password"'
2022-10-08 05:14:20 +02:00
When run keygen -o " ${ PEM_FILE } " -p password username
2022-09-18 13:55:41 +02:00
The path " ${ PEM_FILE } " should exist
The contents of file " ${ PEM_FILE } " should include '-----BEGIN PRIVATE KEY-----'
The contents of file " ${ PEM_FILE } " should include 'MC4CAQAwBQYDK2VwBCIEIA+XqCWjRqCjNe9oU3QA796bEH+T+rxgyPQ/EkXvE2Mv'
The contents of file " ${ PEM_FILE } " should include '-----END PRIVATE KEY-----'
2022-06-25 22:43:28 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe " -f pem -o ${ PEM_FILE } -p password username: "
2022-09-18 13:55:41 +02:00
rm -f " ${ PEM_FILE } "
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
It 'writes pkcs8 secret key to a pem file for user "username" and password "password"'
2022-10-08 05:14:20 +02:00
When run keygen -f pem -o " ${ PEM_FILE } " -p password username
2022-09-18 13:55:41 +02:00
The path " ${ PEM_FILE } " should exist
The contents of file " ${ PEM_FILE } " should include '-----BEGIN PRIVATE KEY-----'
The contents of file " ${ PEM_FILE } " should include 'MC4CAQAwBQYDK2VwBCIEIA+XqCWjRqCjNe9oU3QA796bEH+T+rxgyPQ/EkXvE2Mv'
The contents of file " ${ PEM_FILE } " should include '-----END PRIVATE KEY-----'
2022-09-12 14:19:05 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe " -i ${ PEM_FILE } -k -v: "
It 'prints base58 public and secret keys for ed25519 key read from pkcs8 pem file"'
When run keygen -i " ${ PEM_FILE } " -k -v
The output should include '4YLU1xQ9jzb7LzC6d91VZrYTEKS9N2j93Nnvcee6wxZG'
The output should include 'K5heSX4xGUPtRbxcZh6zbgaKbDv8FeVc9JuSNWtUs7C1oGNKqv7kQJ3DHdouTPzoW4duKKnuLQK8LbHKfN9fkjC'
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
The status should be success
The stderr should include 'input file format detected: pem'
End
rm -f " ${ PEM_FILE } "
End
2022-10-08 05:14:20 +02:00
Describe " -f p2p -o ${ P2P_FILE } -p password username: "
2022-10-01 03:13:35 +02:00
rm -f " ${ P2P_FILE } "
It 'writes libp2p secret key to a p2p file for user "username" and password "password"'
decode_p2p( ) {
xxd -p " ${ P2P_FILE } "
2022-09-18 13:55:41 +02:00
}
not_xxd( ) {
! which xxd >/dev/null 2>& 1
}
Skip if 'You should install xxd' not_xxd
2022-10-08 05:14:20 +02:00
When run keygen -f p2p -o " ${ P2P_FILE } " -p password username
2022-10-01 03:13:35 +02:00
The path " ${ P2P_FILE } " should exist
The result of function decode_p2p should include '080112400f97a825a346a0a335ef68537400efde9b107f93fabc60c8f43f'
The result of function decode_p2p should include '1245ef13632f349a136ef70ffa6e75f97c31ae65aa1da3a9235643d144b0'
The result of function decode_p2p should include '2e3a80995f01a1ab'
2022-09-12 14:19:05 +02:00
The status should be success
The stderr should equal ""
End
2022-09-23 11:33:13 +02:00
End
2022-10-08 05:14:20 +02:00
Describe " -i ${ P2P_FILE } -k -v: "
It 'prints base58 public and secret keys for ed25519 key read from p2p file"'
When run keygen -i " ${ P2P_FILE } " -k -v
The output should include '4YLU1xQ9jzb7LzC6d91VZrYTEKS9N2j93Nnvcee6wxZG'
The output should include 'K5heSX4xGUPtRbxcZh6zbgaKbDv8FeVc9JuSNWtUs7C1oGNKqv7kQJ3DHdouTPzoW4duKKnuLQK8LbHKfN9fkjC'
2022-09-23 11:33:13 +02:00
The status should be success
2022-10-01 03:13:35 +02:00
The stderr should include 'input file format detected: p2p'
2022-09-23 11:33:13 +02:00
End
2022-10-01 03:13:35 +02:00
rm -f " ${ P2P_FILE } "
2022-09-12 14:19:05 +02:00
End
2022-10-08 05:14:20 +02:00
Describe " -f pubsec -o ${ PUBSEC_FILE } -p password username: "
2022-09-18 13:55:41 +02:00
rm -f " ${ PUBSEC_FILE } "
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
It 'writes base58 public and secret keys to a pubsec file for user "username" and password "password"'
2022-10-08 05:14:20 +02:00
When run keygen -f pubsec -o " ${ PUBSEC_FILE } " -p password username
2022-09-18 13:55:41 +02:00
The path " ${ PUBSEC_FILE } " should exist
The contents of file " ${ PUBSEC_FILE } " should include 'Type: PubSec'
The contents of file " ${ PUBSEC_FILE } " should include 'Version: 1'
The contents of file " ${ PUBSEC_FILE } " should include 'pub: 4YLU1xQ9jzb7LzC6d91VZrYTEKS9N2j93Nnvcee6wxZG'
The contents of file " ${ PUBSEC_FILE } " should include 'sec: K5heSX4xGUPtRbxcZh6zbgaKbDv8FeVc9JuSNWtUs7C1oGNKqv7kQJ3DHdouTPzoW4duKKnuLQK8LbHKfN9fkjC'
2022-06-25 22:43:28 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe " -o ${ PUBSEC_FILE } -p password -t duniter username: "
2022-09-18 13:55:41 +02:00
rm -f " ${ PUBSEC_FILE } "
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
It 'writes duniter public and secret keys to a pubsec file for user "username" and password "password"'
2022-10-08 05:14:20 +02:00
When run keygen -o " ${ PUBSEC_FILE } " -p password -t duniter username
2022-09-18 13:55:41 +02:00
The path " ${ PUBSEC_FILE } " should exist
The contents of file " ${ PUBSEC_FILE } " should include 'Type: PubSec'
The contents of file " ${ PUBSEC_FILE } " should include 'Version: 1'
The contents of file " ${ PUBSEC_FILE } " should include 'pub: 4YLU1xQ9jzb7LzC6d91VZrYTEKS9N2j93Nnvcee6wxZG'
The contents of file " ${ PUBSEC_FILE } " should include 'sec: K5heSX4xGUPtRbxcZh6zbgaKbDv8FeVc9JuSNWtUs7C1oGNKqv7kQJ3DHdouTPzoW4duKKnuLQK8LbHKfN9fkjC'
2022-09-15 19:32:01 +02:00
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe " -i ${ PUBSEC_FILE } -k -t ipfs -v: "
It 'prints ipfs public and secret keys for base58 keys read in a pubsec file'
When run keygen -i " ${ PUBSEC_FILE } " -k -t ipfs -v
The output should include '12D3KooWDMhdm5yrvtrbkshXFjkqLedHieUnPioczy9wzdnzquHC'
The output should include 'CAESQA+XqCWjRqCjNe9oU3QA796bEH+T+rxgyPQ/EkXvE2MvNJoTbvcP+m51+XwxrmWqHaOpI1ZD0USwLjqAmV8Boas='
2022-06-25 22:43:28 +02:00
The status should be success
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
The stderr should include 'input file format detected: pubsec'
End
rm -f " ${ PUBSEC_FILE } "
End
2022-10-08 05:14:20 +02:00
Describe " -i ${ SSB_FILE } -k -v: "
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
printf '{ "curve": "ed25519", "public": "cFVodZoKwLcmXbM6UeASdl8+7+Uo8PNOuFnlcqk7qUc=.ed25519", "private": "lUqlXYxjkM0/ljtGnwoM0CfP6ORA2DKZnzsQ4dJ1tKJwVWh1mgrAtyZdszpR4BJ2Xz7v5Sjw8064WeVyqTupRw==.ed25519", "id": "@cFVodZoKwLcmXbM6UeASdl8+7+Uo8PNOuFnlcqk7qUc=.ed25519" }\n' > " ${ SSB_FILE } "
It 'prints prefixed base58 public and secret keys for ed25519 key read from ssb file"'
2022-10-08 05:14:20 +02:00
When run keygen -i " ${ SSB_FILE } " -k -v
The output should include '8ZWCTFBUczYRucyvTgJL6oefj28u243LYU4ZjYKn4XDG'
The output should include '3z7vcMHQhnVPTEEaFQ5gxn2NHkmJsFHkZ4W2aoAvt3Jt5ZYhFV1M6NEkm7Lr75pEF61oSkQVsaih9cQWBP2JmbVQ'
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
The status should be success
The stderr should include 'input file format detected: ssb'
End
rm -f " ${ SSB_FILE } "
End
2022-10-08 05:14:20 +02:00
Describe " -f seed -o ${ SEED_FILE } -p password username: "
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
rm -f " ${ SEED_FILE } "
It 'writes encoded secret key to a wif file for user "username" and password "password"'
2022-10-08 05:14:20 +02:00
When run keygen -f seed -o " ${ SEED_FILE } " -p password username
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
The path " ${ SEED_FILE } " should exist
The contents of file " ${ SEED_FILE } " should include '0f97a825a346a0a335ef68537400efde9b107f93fabc60c8f43f1245ef13632f'
The status should be success
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe " -i ${ SEED_FILE } -k -v: "
It 'prints base58 public and secret keys for ed25519 key read from seed file"'
When run keygen -i " ${ SEED_FILE } " -k -v
The output should include '4YLU1xQ9jzb7LzC6d91VZrYTEKS9N2j93Nnvcee6wxZG'
The output should include 'K5heSX4xGUPtRbxcZh6zbgaKbDv8FeVc9JuSNWtUs7C1oGNKqv7kQJ3DHdouTPzoW4duKKnuLQK8LbHKfN9fkjC'
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
The status should be success
The stderr should include 'input file format detected: seed'
End
rm -f " ${ SEED_FILE } "
End
2022-10-08 05:14:20 +02:00
Describe " -f wif -o ${ WIF_FILE } -p password username: "
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
rm -f " ${ WIF_FILE } "
It 'writes encoded secret key to a wif file for user "username" and password "password"'
2022-10-08 05:14:20 +02:00
When run keygen -f wif -o " ${ WIF_FILE } " -p password username
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
The path " ${ WIF_FILE } " should exist
The contents of file " ${ WIF_FILE } " should include 'Type: WIF'
The contents of file " ${ WIF_FILE } " should include 'Version: 1'
The contents of file " ${ WIF_FILE } " should include 'Data: 7972e1McMMURp9R1MDCH1UMEEnF2bKAjc2WtEW3JyAVwMVT'
The status should be success
2022-06-25 22:43:28 +02:00
The stderr should equal ""
End
End
2022-10-08 05:14:20 +02:00
Describe " -i ${ WIF_FILE } -k -v: "
It 'prints base58 public and secret keys for ed25519 key read from WIF file"'
When run keygen -i " ${ WIF_FILE } " -k -v
The output should include '4YLU1xQ9jzb7LzC6d91VZrYTEKS9N2j93Nnvcee6wxZG'
The output should include 'K5heSX4xGUPtRbxcZh6zbgaKbDv8FeVc9JuSNWtUs7C1oGNKqv7kQJ3DHdouTPzoW4duKKnuLQK8LbHKfN9fkjC'
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
The status should be success
The stderr should include 'input file format detected: wif'
End
rm -f " ${ WIF_FILE } "
End
2022-10-08 05:14:20 +02:00
Describe '-b 0 -p password -t gpg username:'
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
It 'creates a password protected gpg key for user "username"'
2022-06-25 22:43:28 +02:00
Skip "You should implement it !"
2022-10-08 05:14:20 +02:00
When run keygen -b 0 -p password -t pgp username
2022-06-25 22:43:28 +02:00
The status should be success
End
End
2022-10-08 05:14:20 +02:00
Describe '-g -k username:'
2022-09-18 13:55:41 +02:00
gpg --batch --import --quiet specs/username.asc
2022-10-08 05:14:20 +02:00
It 'prints base58 public and secret keys for ed25519 gpg key matching uid "username"'
When run keygen -g -k username
The output should include '2g5UL2zhkn5i7oNYDpWo3fBuWvRYVU1AbMtdVmnGzPNv'
The output should include '5WtYFfA26nTfG496gAKhkrLYUMMnwXexmE1E8Q7PvtQEyscHfirsdMzW34zDp7WEkt3exNEVwoG4ajZYrm62wpi2'
2022-06-25 22:43:28 +02:00
The status should be success
The stderr should equal ""
End
2022-09-18 13:55:41 +02:00
gpg --batch --delete-secret-and-public-key --yes 4D1CDB77E91FFCD81B10F9A7079E5BF4721944FB
2022-06-25 22:43:28 +02:00
End
2022-10-08 05:14:20 +02:00
Describe '-g -k -p password username@protected:'
2022-09-18 13:55:41 +02:00
gpg --batch --import --quiet specs/username_protected.asc
2022-10-08 05:14:20 +02:00
It 'prints public and secret keys for ed25519 gpg key matching uid "username@protected" and locked with password "password"'
When run keygen -g -k -p password username@protected
The output should include 'C1cRu7yb5rZhsmRHQkeZxusAhtYYJypcnXpY3HycEKsU'
The output should include 'VWaEdDroSCoagJDsBnDNUtXJtKAJYdqL6XKNiomz8DtiyF44FvpiMmhidXt2j8HhDBKPZ67xBGcZPnj4Myk6cB8'
2022-08-28 23:26:59 +02:00
The status should be success
The stderr should equal ""
End
2022-09-18 13:55:41 +02:00
gpg --batch --delete-secret-and-public-key --yes 6AF574897D4979B7956AC31B6222A29CBC31A087
2022-08-28 23:26:59 +02:00
End
2022-10-08 05:14:20 +02:00
Describe '-g -k usersame:'
2022-09-18 13:55:41 +02:00
gpg --batch --import --quiet specs/usersame.asc
2022-10-08 05:14:20 +02:00
It 'prints base58 public and secret keys for rsa gpg key matching uid "usersame"'
When run keygen -g -k usersame
The output should include 'EGdSY9fKom7MnvHALNQU7LUoEEE2sju5ntL9eRXJ5tTM'
The output should include '4jPG9MH9LVA7HhcfFs41pXVjxDQLdgu3Mtc64Ph6U3vUMNWfJqTBdFFaviq5r6zJC8PpWUiaUhjVnYAa2E9UrFTZ'
2022-06-25 22:43:28 +02:00
The status should be success
The stderr should equal ""
End
2022-09-18 13:55:41 +02:00
gpg --batch --delete-secret-and-public-key --yes 845E099CFD17FD07346F9D26CAB2E65557C656DF
2022-06-25 22:43:28 +02:00
End
2022-10-08 05:14:20 +02:00
Describe '-g -k -p password usersame@protected:'
2022-09-18 13:55:41 +02:00
gpg --batch --import --quiet specs/usersame_protected.asc
2022-10-08 05:14:20 +02:00
It 'prints public and secret keys for rsa gpg key matching uid "usersame@protected" and locked with password "password"'
When run keygen -g -k -p password usersame@protected
The output should include '6KNNPBxkMYnccYvpePBKDewZ3JiQnmWA4e7QSsvZUzLM'
The output should include '4q4SM9qoWc2eLtfYWs7K9hb7oSCNjCLc8U6ELNrScteVGVnSBP4YMDM5V8RPsHURqCqP5ndPkqGoB74cmRxfJro7'
2022-08-28 23:26:59 +02:00
The status should be success
The stderr should equal ""
End
2022-09-18 13:55:41 +02:00
gpg --batch --delete-secret-and-public-key --yes 78BC5CD37664E5C1AA85AC97ABC22BF0C070C9AD
2022-08-28 23:26:59 +02:00
End
add multiple input/output file formats
* input: credentials, dubp mnemonic, ewif, nacl, pem pksc8, pubsec, seed, ssb, wif
* output: ewif, nacl, pb2, pem pksc8, pubsec, seed, wif
* bump version 0.0.4
2022-09-18 22:55:16 +02:00
Describe " -g -o ${ PUBSEC_FILE } -t duniter username: "
rm -f " ${ PUBSEC_FILE } "
gpg --batch --import --quiet specs/username.asc
It 'writes duniter public and secret keys to a pubsec file for gpg key matching uid "username"'
When run keygen -g -o " ${ PUBSEC_FILE } " -t duniter username
The path " ${ PUBSEC_FILE } " should exist
The contents of file " ${ PUBSEC_FILE } " should include 'Type: PubSec'
The contents of file " ${ PUBSEC_FILE } " should include 'Version: 1'
The contents of file " ${ PUBSEC_FILE } " should include 'pub: 2g5UL2zhkn5i7oNYDpWo3fBuWvRYVU1AbMtdVmnGzPNv'
The contents of file " ${ PUBSEC_FILE } " should include 'sec: 5WtYFfA26nTfG496gAKhkrLYUMMnwXexmE1E8Q7PvtQEyscHfirsdMzW34zDp7WEkt3exNEVwoG4ajZYrm62wpi2'
The status should be success
The stderr should equal ""
End
gpg --batch --delete-secret-and-public-key --yes 4D1CDB77E91FFCD81B10F9A7079E5BF4721944FB
End
2022-06-25 22:43:28 +02:00
End