MCPcopy
hub / github.com/getsops/sops / loadRing

Function loadRing

pgp/keysource.go:596–607  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

594// Unsupported keys are ignored as long as at least a single valid key is
595// found.
596func 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.

Callers 5

getPubRingMethod · 0.85
getSecRingMethod · 0.85
Test_fingerprintIndexFunction · 0.85
Test_loadRingFunction · 0.85

Calls

no outgoing calls

Tested by 3

Test_fingerprintIndexFunction · 0.68
Test_loadRingFunction · 0.68