conf

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrAsCertMissing           = "AS Certificate section missing"
	ErrInvalidValidityDuration = "Invalid validity duration"
	ErrIssuerMissing           = "Parameter Issuer not set in AS certificate"
	ErrTRCVersionNotSet        = "Parameter TRCVersion not set in Base Certificate"
	ErrValidityDurationNotSet  = "Validity duration not set"
	ErrVersionNotSet           = "Parameter Version not set for Base Certificate"
	ErrInvalidSignAlgorithm    = "Invalid sign algorithm"
	ErrInvalidEncAlgorithm     = "Invalid encryption algorithm"
)
View Source
const (
	AsConfFileName    = "as.ini"
	KeyAlgSectionName = "Key Algorithms"
	AsSectionName     = "AS Certificate"
	IssuerSectionName = "Issuer Certificate"
)
View Source
const (
	ErrCoreIANotSet               = "Core ASes are not specified"
	ErrInvalidCoreIA              = "Invalid Core ASes"
	ErrInvalidGracePeriod         = "Invalid Grace Period Duration"
	ErrQuorumTrcGreaterThanCoreIA = "QuorumTRC > # Core ASes"
	ErrQuorumTrcNotSet            = "Quorum TRC not set"
	ErrTrcVersionNotSet           = "Version not set for TRC"
)
View Source
const IsdConfFileName = "isd.ini"

Variables

This section is empty.

Functions

This section is empty.

Types

type As

type As struct {
	*AsCert        `ini:"AS Certificate"`
	*IssuerCert    `ini:"Issuer Certificate,omitempty"`
	*KeyAlgorithms `ini:"Key Algorithms,omitempty"`
}

As contains the as.ini configuration parameters.

func LoadAsConf

func LoadAsConf(dir string) (*As, error)

func NewTemplateAsConf

func NewTemplateAsConf(subject addr.IA, trcVer uint64, core bool) *As

func (*As) Write

func (a *As) Write(path string, force bool) error

type AsCert

type AsCert struct {
	Issuer    string
	IssuerIA  addr.IA `ini:"-"`
	*BaseCert `ini:"AS Certificate"`
}

AsCert corresponds to the "As Certificate" section.

type BaseCert

type BaseCert struct {
	Comment       string        `comment:"Description of the AS and certificate"`
	EncAlgorithm  string        `comment:"Encryption algorithm used by AS, e.g., curve25519xsalsa20poly1305"`
	SignAlgorithm string        `comment:"Signing algotirhm used by AS, e.g., ed25519"`
	IssuingTime   uint32        `comment:"Time of issuance as UNIX epoch. If 0 will be set to now."`
	TRCVersion    uint64        `comment:"The version of the current TRC"`
	Version       uint64        `comment:"The version of the certificate. Cannot be 0"`
	Validity      time.Duration `ini:"-"`
	RawValidity   string        `ini:"Validity" comment:"The validity of the certificate as duration string, e.g., 180d or 36h"`
}

BaseCert holds the parameters that are used to create certs.

func NewTemplateCertConf

func NewTemplateCertConf(trcVer uint64) *BaseCert

type Isd

type Isd struct {
	Desc string `comment:"General description for the ISD"`
	*Trc `ini:"TRC"`
}

Isd holds config parameters read from isd.ini.

func LoadIsdConf

func LoadIsdConf(dir string) (*Isd, error)

func (*Isd) Write

func (i *Isd) Write(path string, force bool) error

type IssuerCert

type IssuerCert struct {
	*BaseCert `ini:"Issuer Certificate"`
}

IssuerCert corresponds to the "Issuer Certificate" section.

type KeyAlgorithms

type KeyAlgorithms struct {
	Online  string `comment:"Signing algorithm used by Online Key, e.g., ed25519"`
	Offline string `comment:"Signing algorithm used by Offline Key, e.g., ed25519"`
}

KeyAlgorithms corresponds to the "Key Algorithms" section

type Trc

type Trc struct {
	Version        uint64        `comment:"The version of the TRC. Must not be 0."`
	IssuingTime    uint32        `comment:"Time of issuance as UNIX epoch. If 0 will be set to now."`
	Validity       time.Duration `ini:"-"`
	RawValidity    string        `ini:"Validity" comment:"The validity of the certificate as duration string, e.g., 180d or 36h"`
	CoreIAs        []addr.IA     `ini:"-"`
	RawCoreIAs     []string      `ini:"CoreASes" comment:"The core ASes of this ISD as comma-separated list, e.g., 1-ff00:0:0,1-ff00:0:1"`
	GracePeriod    time.Duration `ini:"-"`
	RawGracePeriod string        `ini:"GracePeriod" comment:"The grace period for the previous TRC as duration string (see above)"`
	QuorumTRC      uint32        `comment:"The number of core ASes needed to update the TRC"`
}

Trc holds the parameters that are used to generate a Trc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL