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

Method retrievePubKey

pgp/keysource.go:499–511  ·  view source on GitHub ↗

retrievePubKey attempts to retrieve the public key from the public keyring by Fingerprint.

()

Source from the content-addressed store, hash-verified

497// retrievePubKey attempts to retrieve the public key from the public keyring
498// by Fingerprint.
499func (key *MasterKey) retrievePubKey() (openpgp.Entity, error) {
500 ring, err := key.getPubRing()
501 if err == nil {
502 fingerprints := fingerprintIndex(ring)
503 entity, ok := fingerprints[key.Fingerprint]
504 if ok {
505 return entity, nil
506 }
507 }
508 return openpgp.Entity{},
509 fmt.Errorf("key with fingerprint '%s' is not available "+
510 "in keyring", key.Fingerprint)
511}
512
513// getPubRing loads the public keyring from the configured path, or falls back
514// to defaultPubRing relative to the GnuPG home. It returns an openpgp.EntityList

Callers 2

encryptWithOpenPGPMethod · 0.95

Calls 2

getPubRingMethod · 0.95
fingerprintIndexFunction · 0.85

Tested by 1