Add SHA256 fingerprint utils and helpers (#41)

This commit is contained in:
wussler 2020-04-07 14:59:25 +02:00 committed by GitHub
parent c8b7e87135
commit 3c79f40acb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 88 additions and 3 deletions

View file

@ -46,3 +46,12 @@ func GenerateKey(name, email string, passphrase []byte, keyType string, bits int
key.ClearPrivateParams()
return locked.Armor()
}
func GetSHA256Fingerprints(publicKey string) ([]string, error) {
key, err := crypto.NewKeyFromArmored(publicKey)
if err != nil {
return nil, err
}
return key.GetSHA256Fingerprints(), nil
}