MCPcopy Create free account
hub / github.com/git-bug/git-bug / ensurePrivateKey

Method ensurePrivateKey

entities/identity/key.go:190–196  ·  view source on GitHub ↗

ensurePrivateKey attempt to load the corresponding private key if it is not loaded already. If no private key is found, returns errNoPrivateKey

(repo repository.RepoKeyring)

Source from the content-addressed store, hash-verified

188// ensurePrivateKey attempt to load the corresponding private key if it is not loaded already.
189// If no private key is found, returns errNoPrivateKey
190func (k *Key) ensurePrivateKey(repo repository.RepoKeyring) error {
191 if k.private != nil {
192 return nil
193 }
194
195 return k.loadPrivate(repo)
196}
197
198func (k *Key) storePrivate(repo repository.RepoKeyring) error {
199 var buf bytes.Buffer

Callers 2

TestStoreLoadFunction · 0.95
SigningKeyMethod · 0.80

Calls 1

loadPrivateMethod · 0.95

Tested by 1

TestStoreLoadFunction · 0.76