Documentation
¶
Index ¶
- Constants
- Variables
- func CertificatePath(name string) string
- func IsRegistryInsecure(target string) bool
- func KeyPath(name string) string
- func SignaturePath(manifestDigest, signatureDigest digest.Digest) string
- func SignatureRootPath(manifestDigest digest.Digest) string
- type CertificateReference
- type ExternalKey
- type File
- type KeySuite
- type SigningKeys
- type VerificationCertificates
- type X509KeyPair
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" // PluginStoreDirName is the name of the plugin store directory PluginStoreDirName = "plugins" )
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 // PluginDirPath is the path of the plugin store PluginDirPath string )
var ( // ErrKeyNotFound indicates that the signing key is not found. ErrKeyNotFound = errors.New("signing key 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 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 CertificateReference ¶
CertificateReference is a named file path.
func (CertificateReference) Is ¶
func (c CertificateReference) Is(name string) bool
type ExternalKey ¶
type ExternalKey struct {
ID string `json:"id,omitempty"`
PluginName string `json:"pluginName,omitempty"`
PluginConfig map[string]string `json:"pluginConfig,omitempty"`
}
ExternalKey contains the necessary information to delegate the signing operation to the named plugin.
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 KeySuite ¶
type KeySuite struct {
Name string `json:"name"`
*X509KeyPair
*ExternalKey
}
KeySuite is a named key suite.
func ResolveKey ¶
ResolveKey resolves the key by name. The default key is attempted if name is empty.
type SigningKeys ¶
SigningKeys is a collection of signing keys.
type VerificationCertificates ¶
type VerificationCertificates struct {
Certificates []CertificateReference `json:"certs"`
}
VerificationCertificates is a collection of public certs used for verification.
type X509KeyPair ¶
type X509KeyPair struct {
KeyPath string `json:"keyPath,omitempty"`
CertificatePath string `json:"certPath,omitempty"`
}
X509KeyPair contains the paths of a public/private key pair files.