From 9edbb0f47b9273d6f68fb6a84cc678c6ba148111 Mon Sep 17 00:00:00 2001 From: CMEONE Date: Sun, 13 Jun 2021 13:42:06 -0700 Subject: [PATCH] Deterministically generate tEnvoyNaClSigningKey --- node/tenvoy.js | 6 +++++- tenvoy.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/node/tenvoy.js b/node/tenvoy.js index d306ba53..8142e515 100644 --- a/node/tenvoy.js +++ b/node/tenvoy.js @@ -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."; diff --git a/tenvoy.js b/tenvoy.js index 41e6e333..9b796257 100644 --- a/tenvoy.js +++ b/tenvoy.js @@ -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.";