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

Method SigningKey

entities/identity/identity.go:474–487  ·  view source on GitHub ↗

SigningKey return the key that should be used to sign new messages. If no key is available, return nil.

(repo repository.RepoKeyring)

Source from the content-addressed store, hash-verified

472
473// SigningKey return the key that should be used to sign new messages. If no key is available, return nil.
474func (i *Identity) SigningKey(repo repository.RepoKeyring) (*Key, error) {
475 keys := i.Keys()
476 for _, key := range keys {
477 err := key.ensurePrivateKey(repo)
478 if err == errNoPrivateKey {
479 continue
480 }
481 if err != nil {
482 return nil, err
483 }
484 return key, nil
485 }
486 return nil, nil
487}
488
489// ValidKeysAtTime return the set of keys valid at a given lamport time
490func (i *Identity) ValidKeysAtTime(clockName string, time lamport.Time) []*Key {

Callers

nothing calls this directly

Calls 2

KeysMethod · 0.95
ensurePrivateKeyMethod · 0.80

Tested by

no test coverage detected