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

Method getSecRing

pgp/keysource.go:527–539  ·  view source on GitHub ↗

getSecRing loads the sec keyring from the configured path, or falls back to defaultSecRing relative to the GnuPG home. It returns an openpgp.EntityList read from the keyring, or an error.

()

Source from the content-addressed store, hash-verified

525// to defaultSecRing relative to the GnuPG home. It returns an openpgp.EntityList
526// read from the keyring, or an error.
527func (key *MasterKey) getSecRing() (openpgp.EntityList, error) {
528 path := key.secRing
529 if path == "" {
530 path = filepath.Join(gnuPGHome(key.gnuPGHomeDir), defaultSecRing)
531 }
532 if _, err := os.Lstat(path); err != nil {
533 if !os.IsNotExist(err) {
534 return nil, err
535 }
536 return key.getPubRing()
537 }
538 return loadRing(path)
539}
540
541// passphrasePrompt prompts the user for a passphrase when this is required for
542// encryption or decryption.

Callers 2

decryptWithOpenPGPMethod · 0.95
TestMasterKey_getSecRingFunction · 0.80

Calls 3

getPubRingMethod · 0.95
gnuPGHomeFunction · 0.85
loadRingFunction · 0.85

Tested by 1

TestMasterKey_getSecRingFunction · 0.64