pkicmn

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package pkicmn contains some commonly used functionality and definitions.

Index

Constants

View Source
const (
	CertNameFmt     = "ISD%d-AS%s-V%d.crt"
	CoreCertNameFmt = "ISD%d-AS%s-V%d-core.crt"
	IssuerNameFmt   = "ISD%d-AS%s-V%d.issuer"
	TrcNameFmt      = "ISD%d-V%d.trc"
	TRCPartsDirFmt  = "ISD%d-V%d.parts"
	TRCSigPartFmt   = "ISD%d-V%d.%s.sig"
	TRCProtoNameFmt = "ISD%d-V%d.prototype"
	TRCsDir         = "trcs"
	CertsDir        = "certs"
	KeysDir         = "keys"
)
View Source
const (
	ErrInvalidSelector common.ErrMsg = "Invalid selector."
	ErrNoISDDirFound   common.ErrMsg = "No ISD directories found"
	ErrNoASDirFound    common.ErrMsg = "No AS directories found"
)

Error values

Variables

View Source
var (
	RootDir string
	OutDir  string
	Force   bool
	Quiet   bool
)

Functions

func Contains

func Contains(ases []addr.IA, as addr.IA) bool

func ContainsAS added in v0.4.0

func ContainsAS(ases []addr.AS, as addr.AS) bool

func ErrorAndExit

func ErrorAndExit(format string, a ...interface{})

func GetAsPath

func GetAsPath(baseDir string, ia addr.IA) string

func GetIsdPath

func GetIsdPath(baseDir string, isd addr.ISD) string

func ParseSelector added in v0.4.0

func ParseSelector(selector string) (string, string, error)

ParseSelector parses the given selector. The returned strings are in file format.

func QuietPrint

func QuietPrint(format string, a ...interface{})

func WriteToFile

func WriteToFile(raw []byte, path string, perm os.FileMode) error

Types

type ASMap added in v0.4.0

type ASMap map[addr.ISD][]addr.IA

ASMap contains all ASes matched by the selector.

func ProcessSelector

func ProcessSelector(selector string) (ASMap, error)

ProcessSelector processes the given selector and returns a mapping from ISD id to ASes of that ISD. In case of an ISD-only selector, i.e., a '*' or any number the lists of ASes will be empty.

func (ASMap) ISDs added in v0.4.0

func (m ASMap) ISDs() []addr.ISD

ISDs returns all ISDs in the mapping.

type Dirs added in v0.4.0

type Dirs struct {
	Root string
	Out  string
}

Dirs holds the directory configuration.

func GetDirs added in v0.4.0

func GetDirs() Dirs

GetDirs returns the directory configuration.

Jump to

Keyboard shortcuts

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