Documentation
¶
Index ¶
- Constants
- Variables
- func CertificatePath(name string) string
- func IsRegistryInsecure(target string) bool
- func KeyPath(name string) string
- func ResolveCertificatePath(name string) (string, error)
- func ResolveKeyPath(name string) (string, string, error)
- func SignaturePath(manifestDigest, signatureDigest digest.Digest) string
- func SignatureRootPath(manifestDigest digest.Digest) string
- type CertificateMap
- type CertificateReference
- type File
- type KeyMap
- type KeySuite
- type SigningKeys
- type VerificationCertificates
Constants ¶
const ( // ApplicationName is the name of the application ApplicationName = "notation" // FileName is the name of config file FileName = "config.json" // SignatureStoreDirName is the name of the signature store directory SignatureStoreDirName = "signature" // SignatureExtension defines the extension of the signature files SignatureExtension = ".sig" // KeyStoreDirName is the name of the key store directory KeyStoreDirName = "key" // KeyExtension defines the extension of the key files KeyExtension = ".key" // CertificateStoreDirName is the name of the certificate store directory CertificateStoreDirName = "certificate" // CertificateExtension defines the extension of the certificate files CertificateExtension = ".crt" )
Variables ¶
var ( // FilePath is the path of config file FilePath string // SignatureStoreDirPath is the path of the signature store SignatureStoreDirPath string // KeyStoreDirPath is the path of the key store KeyStoreDirPath string // CertificateStoreDirPath is the path of the certificate store CertificateStoreDirPath string )
var ( // ErrKeyNotFound indicates that the signing key is not found. ErrKeyNotFound = errors.New("signing key not found") // ErrCertificateNotFound indicates that the verification certificate is not found. ErrCertificateNotFound = errors.New("verification certificate not found") )
Functions ¶
func CertificatePath ¶
CertificatePath returns the path of a certificate for verification
func IsRegistryInsecure ¶
IsRegistryInsecure checks whether the registry is in the list of insecure registries.
func ResolveCertificatePath ¶
ResolveCertificatePath resolves the certificate path by name.
func ResolveKeyPath ¶
ResolveKeyPath resolves the key path by name along with its corresponding certificate path. The default key is attempted if name is empty.
func SignaturePath ¶
SignaturePath returns the path of a signature for a manifest
func SignatureRootPath ¶
SignatureRootPath returns the root path of signatures for a manifest
Types ¶
type CertificateMap ¶
type CertificateMap []CertificateReference
CertificateMap is a set of CertificateReference indexed by name. The overall performance is O(n) while the order of entries is persevered.
func (*CertificateMap) Append ¶
func (m *CertificateMap) Append(name, path string) bool
Append appends a uniquely named path to the map. Return true if new values are appended.
func (CertificateMap) Get ¶
func (m CertificateMap) Get(name string) (string, bool)
Get return the path of the given name. Return true if found.
func (*CertificateMap) Remove ¶
func (m *CertificateMap) Remove(name string) bool
Remove removes a named path from the map. Return true if an entry is found and removed.
type CertificateReference ¶
CertificateReference is a named file path.
type File ¶
type File struct {
VerificationCertificates VerificationCertificates `json:"verificationCerts"`
SigningKeys SigningKeys `json:"signingKeys,omitempty"`
InsecureRegistries []string `json:"insecureRegistries"`
}
File reflects the config file. Specification: https://github.com/notaryproject/notation/pull/76
func LoadOrDefault ¶
LoadOrDefault reads the config from file or return a default config if not found.
func LoadOrDefaultOnce ¶
LoadOrDefaultOnce returns the previously read config file. If previous config file does not exists, it reads the config from file or return a default config if not found. The returned config is only suitable for read only scenarios for short-lived processes.
type KeyMap ¶
type KeyMap []KeySuite
KeyMap is a set of KeySuite indexed by name. The overall performance is O(n) while the order of entries is persevered.
func (*KeyMap) Append ¶
Append appends a uniquely named KeySuite to the map. Return true if new values are appended.
type KeySuite ¶
type KeySuite struct {
Name string `json:"name"`
KeyPath string `json:"keyPath"`
CertificatePath string `json:"certPath"`
}
KeySuite is a named key suite with file paths.
type SigningKeys ¶
SigningKeys is a collection of signing keys.
type VerificationCertificates ¶
type VerificationCertificates struct {
Certificates CertificateMap `json:"certs"`
}
VerificationCertificates is a collection of public certs used for verification.