MCPcopy
hub / github.com/perkeep/perkeep / newSigner

Function newSigner

pkg/server/share_test.go:50–65  ·  view source on GitHub ↗

newSigner returns the armored public key of the newly created signer as well, so we can upload it to the index.

(t *testing.T)

Source from the content-addressed store, hash-verified

48// newSigner returns the armored public key of the newly created signer as well,
49// so we can upload it to the index.
50func newSigner(t *testing.T) (*schema.Signer, string) {
51 ent, err := jsonsign.NewEntity()
52 if err != nil {
53 t.Fatal(err)
54 }
55 armorPub, err := jsonsign.ArmoredPublicKey(ent)
56 if err != nil {
57 t.Fatal(err)
58 }
59 pubRef := blob.RefFromString(armorPub)
60 sig, err := schema.NewSigner(pubRef, strings.NewReader(armorPub), ent)
61 if err != nil {
62 t.Fatalf("NewSigner: %v", err)
63 }
64 return sig, armorPub
65}
66
67func newShareTester(t *testing.T) *shareTester {
68 return newShareTesterIdx(t, false)

Callers 1

newShareTesterIdxFunction · 0.70

Calls 6

NewEntityFunction · 0.92
ArmoredPublicKeyFunction · 0.92
RefFromStringFunction · 0.92
NewSignerFunction · 0.92
FatalMethod · 0.80
FatalfMethod · 0.65

Tested by

no test coverage detected