Skip to content

Commit

Permalink
Use readKeyFile to read both seed file and public key file
Browse files Browse the repository at this point in the history
It's consistent with the key reading behavior in `sign`, and we can add some
comments in both seed file and public key file.

Signed-off-by: JUN JIE NAN <nanjunjie@gmail.com>
  • Loading branch information
nanjj committed Jun 25, 2023
1 parent 64eab80 commit 6125209
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions nk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,11 @@ func verify(fname, keyFile, pubFile, sigFile string) {
var err error
var kp nkeys.KeyPair
if keyFile != "" {
var seed []byte
seed, err = os.ReadFile(keyFile)
if err != nil {
log.Fatal(err)
}
seed := readKeyFile(keyFile)
kp, err = nkeys.FromSeed(seed)
} else {
// Public Key
var public []byte
public, err = os.ReadFile(pubFile)
if err != nil {
log.Fatal(err)
}
public := readKeyFile(pubFile)
kp, err = nkeys.FromPublicKey(string(public))
}
if err != nil {
Expand Down

0 comments on commit 6125209

Please sign in to comment.