Print Fingerprint for each identity. Orig from jrick.
This commit is contained in:
parent
3450db4437
commit
39b3fae508
14
main.go
14
main.go
@ -8,6 +8,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"text/tabwriter"
|
||||||
|
|
||||||
"golang.org/x/crypto/openpgp"
|
"golang.org/x/crypto/openpgp"
|
||||||
"golang.org/x/crypto/openpgp/clearsign"
|
"golang.org/x/crypto/openpgp/clearsign"
|
||||||
@ -66,6 +67,15 @@ func main() {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if flags.sig == "" && flags.file == "" {
|
||||||
|
for _, ent := range kr {
|
||||||
|
for name := range ent.Identities {
|
||||||
|
fmt.Printf("%q (%X)\n", name, ent.PrimaryKey.Fingerprint)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var sig, message io.Reader
|
var sig, message io.Reader
|
||||||
var clearsigBlock *clearsign.Block
|
var clearsigBlock *clearsign.Block
|
||||||
var armored bool
|
var armored bool
|
||||||
@ -115,8 +125,10 @@ func main() {
|
|||||||
}
|
}
|
||||||
errExit(err)
|
errExit(err)
|
||||||
|
|
||||||
|
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
|
||||||
for _, id := range ent.Identities {
|
for _, id := range ent.Identities {
|
||||||
fmt.Printf("%q\n", id.Name)
|
fmt.Fprintf(w, "%q\t(%X)\n", id.Name, ent.PrimaryKey.Fingerprint)
|
||||||
}
|
}
|
||||||
|
w.Flush()
|
||||||
fmt.Println("Signature OK.")
|
fmt.Println("Signature OK.")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user