Skip to content

Commit

Permalink
Printing out public key from private
Browse files Browse the repository at this point in the history
  • Loading branch information
tilenflare committed Jun 11, 2024
1 parent 703aaa2 commit 987a374
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions go-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ go run keygen/keygen.go --key 0x1512de600a10a0aac01580dbfc080965b89ed2329a7b2bf5

where the key value needs to be replaced by the generated private key and the address value needs
to be replaced by the actual address that will be used to sign the updates.

In case you forgot your public key, but saved the private one, you can run the following for outputting the key:
```bash
go run keygen/keygen.go --key 0x1512de600a10a0aac01580dbfc080965b89ed2329a7b2bf538f4c7e09e34aa1
```

Alternatively, one can save and read the (encrypted) key from a file and save the signature with:

```bash
Expand Down
4 changes: 2 additions & 2 deletions go-client/keygen/keygen.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ func main() {
logger.Info("Saved the signature in file " + *SigOutFlag)
}
} else {
// in case that key was read and decrypted from a file, but not used for the signature, just print it
if *InFileFlag != "" {
// in the case that a key was provided but not used for the signature, just print it out
if *InFileFlag != "" || *InFlag != "" {
keysString := keyStrings{PrivateKey: "0x" + keys.Sk.Text(16), PublicKeyX: "0x" + keys.Pk.X.Text(16), PublicKeyY: "0x" + keys.Pk.Y.Text(16)}
keyBytes, err := json.Marshal(keysString)
if err != nil {
Expand Down

0 comments on commit 987a374

Please sign in to comment.