Skip to content

Commit

Permalink
add change to allow use of long key id
Browse files Browse the repository at this point in the history
  • Loading branch information
esilva-everbridge committed Jul 16, 2018
1 parent 991987d commit 132b017
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pki/pki.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@ func (p *Pki) DecryptSecret(cipherText string) (plainText string, err error) {
// GetKeyByID returns a keyring by the given ID
func (p *Pki) GetKeyByID(keyring openpgp.EntityList, id interface{}) *openpgp.Entity {
for _, entity := range keyring {
if entity.PrimaryKey != nil && entity.PrimaryKey.KeyIdString() == id.(string) {
return entity
}
if entity.PrivateKey != nil && entity.PrivateKey.KeyIdString() == id.(string) {
return entity
}

for _, ident := range entity.Identities {
if checkMatch(id.(string), ident.Name) {
return entity
Expand Down

0 comments on commit 132b017

Please sign in to comment.