conf

package
v0.0.0-...-c8fc2fc Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorAddr      = "Unable to load addresses"
	ErrorKeyConf   = "Unable to load KeyConf"
	ErrorStore     = "Unable to load TrustStore"
	ErrorTopo      = "Unable to load topology"
	ErrorCustomers = "Unable to load Customers"
)
View Source
const (
	KeyChanged   = "Verifying key has changed in the meantime"
	NotACustomer = "ISD-AS not in custommer mapping"
	CustomersDir = "customers"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	// Topo contains the names of all local infrastructure elements, a map
	// of interface IDs to routers, and the actual topology.
	Topo *topology.Topo
	// 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

	// CacheDir is the cache directory.
	CacheDir string
	// ConfDir is the configuration directory.
	ConfDir string
	// StateDir is the state directory.
	StateDir string
	// contains filtered or unexported fields
}

func Load

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

Load initializes the configuration by loading it from confDir.

func (*Conf) GetDecryptKey

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

GetDecryptKey returns the decryption 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) GetSigningKey

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

GetSigningKey returns the signing key of the current key configuration.

func (*Conf) GetVerifyingKey

func (c *Conf) GetVerifyingKey(ia *addr.ISD_AS) (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 (*Conf) LoadCustomers

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

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

func (*Conf) ReloadCustomers

func (c *Conf) ReloadCustomers() error

ReloadCustomers reloads the mapping from customer to verifying key.

func (*Conf) SetVerifyingKey

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

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

type Customers

type Customers map[addr.ISD_AS]common.RawBytes

Jump to

Keyboard shortcuts

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