Skip to content

Commit

Permalink
Deterministically generate tEnvoyNaClSigningKey
Browse files Browse the repository at this point in the history
  • Loading branch information
CMEONE committed Jun 13, 2021
1 parent 3478e77 commit 9edbb0f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion node/tenvoy.js
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,12 @@ function tEnvoy(openpgpRef = openpgp, naclRef = nacl, sha256Ref = sha256) {
publicKey = privateKey.toPublic();
} else if(args.keyType == "public") {
publicKey = new tEnvoyNaClKey(args.key, "public", args.password, args.passwordProtected, this);
} else if(args.keyType == "privateSigning") {
privateSigningKey = new tEnvoyNaClSigningKey(args.key, "private", args.password, args.passwordProtected, this);
} else if(args.keyType == "publicSigning") {
publicSigningKey = new tEnvoyNaClSigningKey(args.key, "public", args.password, args.passwordProtected, this);
} else {
throw "tEnvoy Fatal Error: argument keyType of object args of method keyFactory.genNaClKeys must either be public or private. For secret (or shared) keys, use keyFactory.genNaClSymmetricKey instead.";
throw "tEnvoy Fatal Error: argument keyType of object args of method keyFactory.genNaClKeys must either be private, public, privateSigning, or publicSigning. For secret (or shared) keys, use keyFactory.genNaClSymmetricKey instead.";
}
} else {
throw "tEnvoy Fatal Error: argument keyType of object args of method keyFactory.genNaClKeys is required when using args.key and does not have a default value.";
Expand Down
6 changes: 5 additions & 1 deletion tenvoy.js
Original file line number Diff line number Diff line change
Expand Up @@ -46968,8 +46968,12 @@ function tEnvoy(openpgpRef = openpgp, naclRef = nacl, sha256Ref = sha256) {
publicKey = privateKey.toPublic();
} else if(args.keyType == "public") {
publicKey = new tEnvoyNaClKey(args.key, "public", args.password, args.passwordProtected, this);
} else if(args.keyType == "privateSigning") {
privateSigningKey = new tEnvoyNaClSigningKey(args.key, "private", args.password, args.passwordProtected, this);
} else if(args.keyType == "publicSigning") {
publicSigningKey = new tEnvoyNaClSigningKey(args.key, "public", args.password, args.passwordProtected, this);
} else {
throw "tEnvoy Fatal Error: argument keyType of object args of method keyFactory.genNaClKeys must either be public or private. For secret (or shared) keys, use keyFactory.genNaClSymmetricKey instead.";
throw "tEnvoy Fatal Error: argument keyType of object args of method keyFactory.genNaClKeys must either be private, public, privateSigning, or publicSigning. For secret (or shared) keys, use keyFactory.genNaClSymmetricKey instead.";
}
} else {
throw "tEnvoy Fatal Error: argument keyType of object args of method keyFactory.genNaClKeys is required when using args.key and does not have a default value.";
Expand Down

0 comments on commit 9edbb0f

Please sign in to comment.