GetPublicKeyByID returns public key by given ID.
(keyID int64)
| 433 | |
| 434 | // GetPublicKeyByID returns public key by given ID. |
| 435 | func GetPublicKeyByID(keyID int64) (*PublicKey, error) { |
| 436 | key := new(PublicKey) |
| 437 | has, err := x.Id(keyID).Get(key) |
| 438 | if err != nil { |
| 439 | return nil, err |
| 440 | } else if !has { |
| 441 | return nil, ErrKeyNotExist{keyID} |
| 442 | } |
| 443 | return key, nil |
| 444 | } |
| 445 | |
| 446 | // SearchPublicKeyByContent searches a public key using the content as prefix |
| 447 | // (i.e. ignore the email part). It returns ErrKeyNotExist if no such key |
no test coverage detected