conf

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IssuerReissTime is the default value for Conf.IssuerReissTime. It is the same
	// as the leaf certificate validity period in order to provide optimal coverage.
	IssuerReissTime = cert.DefaultLeafCertValidity * time.Second
	// ReissReqRate is the default interval between two consecutive reissue requests.
	ReissReqRate = 10 * time.Second

	ErrorAddr      = "Unable to load addresses"
	ErrorIssCert   = "Unable to load issuer certificate"
	ErrorKeyConf   = "Unable to load KeyConf"
	ErrorConfNil   = "Unable to reload conf from nil value"
	ErrorStore     = "Unable to load TrustStore"
	ErrorTopo      = "Unable to load topology"
	ErrorTrustDB   = "Unable to load trust DB"
	ErrorCustomers = "Unable to load Customers"
)
View Source
const (
	KeyChanged   = "Verifying key has changed in the meantime"
	NotACustomer = "ISD-AS not in customer mapping"

	CustomersDir = "customers"
)

Variables

This section is empty.

Functions

func Set

func Set(c *Conf)

Set updates the current configuration.

Types

type Conf

type Conf struct {
	// ID is the element ID.
	ID string
	// Topo contains the names of all local infrastructure elements, a map
	// of interface IDs to routers, and the actual topology.
	Topo *topology.Topo
	// ASConf is the local AS configuration.
	ASConf *as_conf.ASConf
	// MasterKeys holds the local AS master keys.
	MasterKeys *as_conf.MasterKeys
	// BindAddr is the local bind address.
	BindAddr *snet.Addr
	// PublicAddr is the public address.
	PublicAddr *snet.Addr
	// Store is the trust store.
	Store *trust.Store
	// TrustDB is the trust DB.
	TrustDB *trustdb.DB

	// Customers is a mapping from non-core ASes assigned to this core AS to their public
	// verifying key.
	Customers *Customers
	// ConfDir is the configuration directory.
	ConfDir string
	// StateDir is the state directory.
	StateDir string

	// LeafReissTime is the time between starting reissue requests and leaf cert expiration.
	LeafReissTime time.Duration
	// IssuerReissTime is the time between self issuing core cert and core cert expiration.
	IssuerReissTime time.Duration
	// ReissRate is the interval between two consecutive reissue requests.
	ReissRate time.Duration
	// RequestID is used to generate unique request IDs for the messenger
	RequestID messenger.Counter
	// contains filtered or unexported fields
}

func Get

func Get() *Conf

Get returns a pointer to the current configuration.

func Load

func Load(id string, confDir string, stateDir string) (*Conf, error)

Load initializes the configuration by loading it from confDir.

func ReloadConf

func ReloadConf(oldConf *Conf) (*Conf, error)

ReloadConf loads a new configuration based on the old one.

func (*Conf) GetDecryptKey

func (c *Conf) GetDecryptKey() common.RawBytes

GetDecryptKey returns the decryption key of the current key configuration.

func (*Conf) GetIssSigningKey

func (c *Conf) GetIssSigningKey() common.RawBytes

GetIssSigningKey returns the issuer signing key of the current key configuration.

func (*Conf) GetOnRootKey

func (c *Conf) GetOnRootKey() common.RawBytes

GetOnRootKey returns the online root key of the current key configuration.

func (*Conf) GetSigner

func (c *Conf) GetSigner() ctrl.Signer

GetSigner returns the signer of the current configuration.

func (*Conf) GetSigningKey

func (c *Conf) GetSigningKey() common.RawBytes

GetSigningKey returns the signing key of the current key configuration.

func (*Conf) GetVerifier

func (c *Conf) GetVerifier() ctrl.SigVerifier

GetVerifier returns the verifier of the current configuration.

func (*Conf) LoadCustomers

func (c *Conf) LoadCustomers() (*Customers, error)

LoadCustomers populates the mapping from assigned non-core ASes to their verifying key.

func (*Conf) SetSigner

func (c *Conf) SetSigner(signer ctrl.Signer)

SetSigner sets the signer of the current configuration.

func (*Conf) SetVerifier

func (c *Conf) SetVerifier(verifier ctrl.SigVerifier)

SetVerifier sets the verifier of the current configuration.

type Customers

type Customers struct {
	// contains filtered or unexported fields
}

Customers is a mapping from non-core ASes assigned to this core AS to their public verifying key.

func (*Customers) GetVerifyingKey

func (c *Customers) GetVerifyingKey(ia addr.IA) (common.RawBytes, error)

GetVerifyingKey returns the verifying key from the requested AS and nil if it is in the mapping. Otherwise, nil and an error.

func (*Customers) SetVerifyingKey

func (c *Customers) SetVerifyingKey(ia addr.IA, ver uint64, newKey, oldKey common.RawBytes) error

SetVerifyingKey sets the verifying key for a specified AS. The key is written to the file system.

Jump to

Keyboard shortcuts

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