loadRing attempts to load the keyring from the provided path. Unsupported keys are ignored as long as at least a single valid key is found.
(path string)
| 594 | // Unsupported keys are ignored as long as at least a single valid key is |
| 595 | // found. |
| 596 | func loadRing(path string) (openpgp.EntityList, error) { |
| 597 | f, err := os.Open(path) |
| 598 | if err != nil { |
| 599 | return nil, err |
| 600 | } |
| 601 | defer f.Close() |
| 602 | keyring, err := openpgp.ReadKeyRing(f) |
| 603 | if err != nil { |
| 604 | return nil, err |
| 605 | } |
| 606 | return keyring, nil |
| 607 | } |
| 608 | |
| 609 | // fingerprintIndex indexes the openpgp.Entity objects from the given ring |
| 610 | // by their fingerprint, and returns the result. |
no outgoing calls