Add KeyIDs public API functionality (#76)
* Add public KeyIDs functions * Add signature keyIDs functions * Lint code
This commit is contained in:
parent
1f4d966115
commit
2f89b9fa0e
7 changed files with 212 additions and 9 deletions
|
|
@ -332,7 +332,7 @@ func (key *Key) PrintFingerprints() {
|
|||
|
||||
// GetHexKeyID returns the key ID, hex encoded as a string.
|
||||
func (key *Key) GetHexKeyID() string {
|
||||
return strconv.FormatUint(key.GetKeyID(), 16)
|
||||
return keyIDToHex(key.GetKeyID())
|
||||
}
|
||||
|
||||
// GetKeyID returns the key ID, encoded as 8-byte int.
|
||||
|
|
@ -465,3 +465,8 @@ func generateKey(
|
|||
|
||||
return &Key{newEntity}, nil
|
||||
}
|
||||
|
||||
// keyIDToHex casts a keyID to hex with the correct padding.
|
||||
func keyIDToHex(keyID uint64) string {
|
||||
return fmt.Sprintf("%016v", strconv.FormatUint(keyID, 16))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue