mirror of
https://github.com/FiloSottile/age.git
synced 2026-09-10 01:56:18 +00:00
all: switch key format to Bech32
Use the BIP173 format, which is whole-word selectable, markup safe, and case insensitive. AGE-SECRET-KEY-1FPSHVEFQXYSX5MMFDE6ZCGRTV4JHQGRFWSS8WETVDSSX76TVV4JQU272CR See https://groups.google.com/d/msg/age-dev/UAjkvLoCr9I/l4Q1h3OPAgAJ. All bech32 Go packages have funky APIs, internal types, or case handling, so include a heavily refactored version of the reference implementation, and the tests from github.com/btcsuite/btcutil/bech32.
This commit is contained in:
committed by
Filippo Valsorda
parent
8c600131ec
commit
9a84e437b1
@@ -53,6 +53,6 @@ func generate(out io.Writer) {
|
||||
}
|
||||
|
||||
fmt.Fprintf(out, "# created: %s\n", time.Now().Format(time.RFC3339))
|
||||
fmt.Fprintf(out, "# %s\n", k.Recipient())
|
||||
fmt.Fprintf(out, "# public key: %s\n", k.Recipient())
|
||||
fmt.Fprintf(out, "%s\n", k)
|
||||
}
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
func parseRecipient(arg string) (age.Recipient, error) {
|
||||
switch {
|
||||
case strings.HasPrefix(arg, "pubkey:"):
|
||||
case strings.HasPrefix(arg, "age1"):
|
||||
return age.ParseX25519Recipient(arg)
|
||||
case strings.HasPrefix(arg, "ssh-"):
|
||||
return age.ParseSSHRecipient(arg)
|
||||
|
||||
Reference in New Issue
Block a user