package config

import "github.com/cloudflare/cfssl/multiroot/config"

Package config contains the multi-root configuration file parser.

Index

Variables

var (
	// ErrMissingPrivateKey indicates that the configuration is
	// missing a private key specifier.
	ErrMissingPrivateKey = errors.New("config: root is missing private key spec")

	// ErrMissingCertificatePath indicates that the configuration
	// is missing a certificate specifier.
	ErrMissingCertificatePath = errors.New("config: root is missing certificate path")

	// ErrMissingConfigPath indicates that the configuration lacks
	// a valid CFSSL configuration.
	ErrMissingConfigPath = errors.New("config: root is missing configuration file path")

	// ErrInvalidConfig indicates the configuration is invalid.
	ErrInvalidConfig = errors.New("config: invalid configuration")

	// ErrUnsupportedScheme indicates a private key scheme that is not currently supported.
	ErrUnsupportedScheme = errors.New("config: unsupported private key scheme")
)

Types

type RawMap

type RawMap map[string]map[string]string

RawMap is shorthand for the type used as a map from string to raw Root struct.

func ParseToRawMap

func ParseToRawMap(fileName string) (cfg RawMap, err error)

ParseToRawMap takes the filename as a string and returns a RawMap.

func (*RawMap) SectionInConfig

func (c *RawMap) SectionInConfig(section string) bool

SectionInConfig determines whether a section is in the configuration.

type Root

type Root struct {
	PrivateKey  crypto.Signer
	Certificate *x509.Certificate
	Config      *config.Signing
	ACL         whitelist.NetACL
	DB          *sqlx.DB
}

A Root represents a single certificate authority root key pair.

func LoadRoot

func LoadRoot(cfg map[string]string) (*Root, error)

LoadRoot parses a config structure into a Root structure

type RootList

type RootList map[string]*Root

A RootList associates a set of labels with the appropriate private keys and their certificates.

func Parse

func Parse(filename string) (RootList, error)

Parse loads a RootList from a file.

Source Files

config.go

Version
v1.6.5 (latest)
Published
Mar 5, 2024
Platform
linux/amd64
Imports
20 packages
Last checked
6 days ago

Tools for package owners.