MCPcopy Create free account
hub / github.com/canonical/snapd / Encode

Method Encode

asserts/asserts.go:1014–1016  ·  view source on GitHub ↗

Encode emits the assertion into the stream with the required separator. Errors here are always about writing given that Encode() itself cannot error.

(assert Assertion)

Source from the content-addressed store, hash-verified

1012// Encode emits the assertion into the stream with the required separator.
1013// Errors here are always about writing given that Encode() itself cannot error.
1014func (enc *Encoder) Encode(assert Assertion) error {
1015 return enc.WriteContentSignature(assert.Signature())
1016}
1017
1018// SignatureCheck checks the signature of the assertion against the given public key. Useful for assertions with no authority.
1019func SignatureCheck(assert Assertion, pubKey PublicKey) error {

Callers 15

writeAssertionsMethod · 0.95
writeMetaMethod · 0.95
WriteAssertionsFunction · 0.95
TestAddStreamMethod · 0.95
TestEncoderOKMethod · 0.95
saveStreamMethod · 0.95
signSeqRepairsMethod · 0.95
signSeqRepairsMethod · 0.95

Calls 2

WriteContentSignatureMethod · 0.95
SignatureMethod · 0.65

Tested by 15

TestAddStreamMethod · 0.76
TestEncoderOKMethod · 0.76
signSeqRepairsMethod · 0.76
signSeqRepairsMethod · 0.76
TestAppStatusMethod · 0.76
TestServiceCompletionMethod · 0.76
EncodeResponseBodyFunction · 0.76