Documentation ¶
Overview ¶
Package conf defines the configuration files for the scion-pki tool.
Config files ¶
The way scion-pki generates trust material, such as TRCs or certificates, can be configured through configuration files. There are four configuration file types:
TRC: For each TRC version, there is exactly one configuration file. The config specifies the contents of the TRC (e.g. the validity period, the voting ASes and which keys to use).
Keys: Each AS has a keys configuration file that specifies all keys with their version, validity and algorithm.
AS certificate: For each AS certificate version, there is exactly one configuration file. The config specifies the contents of the certificate (e.g. the validity period, the issuing AS, and which keys to use).
Issuer certificate: For each Issuer certificate version, there is exactly one configuration file. The config specifies the contents of the certificate (e.g. the validity period, the issuing AS, and which keys to use).
Directory Structure ¶
The directory structure how config files are arranged and the file naming is rigid. A sample tree is shown below. This package exposes a set of helper functions to determine the correct file names.
<root>/ ├── ISD1 │ ├── ASff00_0_110 │ │ ├── as-v1.toml │ │ ├── iss-v1.toml │ │ ├── keys.toml │ │ ... │ ├── ASff00_0_120 │ │ ├── as-v1.toml │ │ ├── as-v2.toml │ │ ├── keys.toml │ │ ... │ ├── ASff00_0_130 │ │ ... │ ├── trc-v1.toml │ ... ├── ISD2 ...
Index ¶
- func ASFile(dir string, ia addr.IA, version scrypto.Version) string
- func AllASFiles(dir string, ia addr.IA) string
- func AllIssuerFiles(dir string, ia addr.IA) string
- func AllTRCFiles(dir string, isd addr.ISD) string
- func IssuerFile(dir string, ia addr.IA, version scrypto.Version) string
- func KeysFile(dir string, ia addr.IA) string
- func TRCFile(dir string, isd addr.ISD, version scrypto.Version) string
- type AS
- type Issuer
- type KeyMeta
- type Keys
- type Primary
- type TRC
- type Validity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ASFile ¶ added in v0.5.0
ASFile returns the file where the AS certificate config is written to.
func AllASFiles ¶ added in v0.5.0
AllASFiles returns a glob string that matches all AS files for the given IA.
func AllIssuerFiles ¶ added in v0.5.0
AllIssuerFiles returns a glob string that matches all issuer files for the given IA.
func AllTRCFiles ¶ added in v0.5.0
AllTRCFiles returns a glob string that matches all TRC files for the given isd.
func IssuerFile ¶ added in v0.5.0
IssuerFile returns the file where the issuer certificate config is written to.
Types ¶
type AS ¶ added in v0.5.0
type AS struct { Description string `toml:"description"` Version scrypto.Version `toml:"version"` SigningKeyVersion *scrypto.KeyVersion `toml:"signing_key_version"` EncryptionKeyVersion *scrypto.KeyVersion `toml:"encryption_key_version"` RevocationKeyVersion *scrypto.KeyVersion `toml:"revocation_key_version"` IssuerIA addr.IA `toml:"issuer_ia"` IssuerCertVersion scrypto.Version `toml:"issuer_cert_version"` OptDistPoints []addr.IA `toml:"optional_distribution_points"` Validity Validity `toml:"validity"` }
AS holds the AS certificate configuration.
func LoadAS ¶ added in v0.5.0
LoadAS loads the AS certificate configuration from the provided file. The contents are already validated.
type Issuer ¶ added in v0.5.0
type Issuer struct { Description string `toml:"description"` Version scrypto.Version `toml:"version"` IssuingGrantKeyVersion *scrypto.KeyVersion `toml:"issuing_grant_key_version"` RevocationKeyVersion *scrypto.KeyVersion `toml:"revocation_key_version"` TRCVersion scrypto.Version `toml:"trc_version"` OptDistPoints []addr.IA `toml:"optional_distribution_points"` Validity Validity `toml:"validity"` }
Issuer holds the issuer certificate configuration.
func LoadIssuer ¶ added in v0.5.0
LoadIssuer loads the issuer certificate configuration from the provided file. The contents are already validated.
type Keys ¶ added in v0.5.0
type Keys struct { Primary map[trc.KeyType]map[scrypto.KeyVersion]KeyMeta Issuer map[cert.KeyType]map[scrypto.KeyVersion]KeyMeta AS map[cert.KeyType]map[scrypto.KeyVersion]KeyMeta }
Keys holds the key configuration.
func LoadKeys ¶ added in v0.5.0
LoadKeys loads the keys from the provided file. The contents are already validated.
type Primary ¶ added in v0.5.0
type Primary struct { Attributes trc.Attributes `toml:"attributes"` IssuingGrantKeyVersion *scrypto.KeyVersion `toml:"issuing_grant_key_version"` VotingOnlineKeyVersion *scrypto.KeyVersion `toml:"voting_online_key_version"` VotingOfflineKeyVersion *scrypto.KeyVersion `toml:"voting_offline_key_version"` }
Primary holds the primary AS configuration.
type TRC ¶ added in v0.5.0
type TRC struct { Description string Version scrypto.Version BaseVersion scrypto.Version VotingQuorum uint16 GracePeriod util.DurWrap TrustResetAllowed *bool Votes []addr.AS Validity Validity PrimaryASes map[addr.AS]Primary }
TRC holds the TRC configuration.
func LoadTRC ¶ added in v0.5.0
LoadTRC loads the TRC configuration from the provided file. The contents are already validated.
type Validity ¶ added in v0.5.0
type Validity struct { NotBefore uint32 `toml:"not_before"` Validity util.DurWrap `toml:"validity"` }
Validity defines a validity period.