Skip to content

Commit

Permalink
Merge pull request #20 from github/bad-cert
Browse files Browse the repository at this point in the history
list-keys: failing to get one certificate shouldn't be fatal
  • Loading branch information
mastahyeti authored Sep 12, 2018
2 parents f91f4ae + 8e31739 commit 5d1ce27
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions list_keys_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@ package main

import (
"fmt"
"os"
"strings"

"github.com/pkg/errors"
)

func commandListKeys() error {
for j, ident := range idents {
cert, err := ident.Certificate()
if err != nil {
return errors.Wrap(err, "failed to get identity certificate")
}

if j > 0 {
fmt.Println("————————————————————")
}

cert, err := ident.Certificate()
if err != nil {
fmt.Fprintln(os.Stderr, "WARNING:", errors.Wrap(err, "failed to get identity certificate"))
continue
}

fmt.Println(" ID:", certHexFingerprint(cert))
fmt.Println(" S/N:", cert.SerialNumber.Text(16))
fmt.Println("Algorithm:", cert.SignatureAlgorithm.String())
Expand Down

0 comments on commit 5d1ce27

Please sign in to comment.