MCPcopy Create free account
hub / github.com/docker/cli / getOrGenerateRootKeyAndInitRepo

Function getOrGenerateRootKeyAndInitRepo

cmd/docker-trust/trust/helpers.go:43–49  ·  view source on GitHub ↗

getOrGenerateRootKeyAndInitRepo initializes the notary repository with a remotely managed snapshot key. The initialization will use an existing root key if one is found, else a new one will be generated.

(notaryRepo client.Repository)

Source from the content-addressed store, hash-verified

41// with a remotely managed snapshot key. The initialization will use
42// an existing root key if one is found, else a new one will be generated.
43func getOrGenerateRootKeyAndInitRepo(notaryRepo client.Repository) error {
44 rootKey, err := getOrGenerateNotaryKey(notaryRepo, data.CanonicalRootRole)
45 if err != nil {
46 return err
47 }
48 return notaryRepo.Initialize([]string{rootKey.ID()}, data.CanonicalSnapshotRole)
49}
50
51const testPass = "password"
52

Callers 1

addSignerToRepoFunction · 0.85

Calls 3

getOrGenerateNotaryKeyFunction · 0.85
InitializeMethod · 0.45
IDMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…