Documentation ¶
Overview ¶
Package snapasserts offers helpers to handle snap assertions and their checking for installation.
Index ¶
- func CrossCheck(instanceName, snapSHA3_384 string, snapSize uint64, si *snap.SideInfo, ...) error
- func DeriveSideInfo(snapPath string, db Finder) (*snap.SideInfo, error)
- func FetchSnapAssertions(f asserts.Fetcher, snapSHA3_384 string) error
- func FetchSnapDeclaration(f asserts.Fetcher, snapID string) error
- func FetchStore(f asserts.Fetcher, storeID string) error
- type Finder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CrossCheck ¶
func CrossCheck(instanceName, snapSHA3_384 string, snapSize uint64, si *snap.SideInfo, db Finder) error
CrossCheck tries to cross check the instance name, hash digest and size of a snap plus its metadata in a SideInfo with the relevant snap assertions in a database that should have been populated with them.
func DeriveSideInfo ¶
DeriveSideInfo tries to construct a SideInfo for the given snap using its digest to find the relevant snap assertions with the information in the given database. It will fail with an asserts.NotFoundError if it cannot find them.
func FetchSnapAssertions ¶
FetchSnapAssertions fetches the assertions matching the snap file digest using the given fetcher.
func FetchSnapDeclaration ¶
FetchSnapDeclaration fetches the snap declaration and its prerequisites for the given snap id using the given fetcher.
Types ¶
type Finder ¶
type Finder interface { // Find an assertion based on arbitrary headers. Provided // headers must contain the primary key for the assertion // type. It returns a asserts.NotFoundError if the assertion // cannot be found. Find(assertionType *asserts.AssertionType, headers map[string]string) (asserts.Assertion, error) }