config

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgorithmKey

type AlgorithmKey string

AlgorithmKey is key type alias for the algorithm.

const (
	// RSAPKCS1v15SHA256 is the key for algorithm "RSASSA-PKCS1-v1_5-SHA256".
	RSAPKCS1v15SHA256 AlgorithmKey = "RSASSA-PKCS1-v1_5-SHA256"
	// RSAPKCS1v15SHA384 is the key for algorithm "RSASSA-PKCS1-v1_5-SHA384".
	RSAPKCS1v15SHA384 AlgorithmKey = "RSASSA-PKCS1-v1_5-SHA384"
	// RSAPKCS1v15SHA512 is the key for algorithm "RSASSA-PKCS1-v1_5-SHA512".
	RSAPKCS1v15SHA512 AlgorithmKey = "RSASSA-PKCS1-v1_5-SHA512"

	// RSASSAPSSSHA256 is the key for algorithm "RSASSA-PSS-SHA256".
	RSASSAPSSSHA256 AlgorithmKey = "RSASSA-PSS-SHA256"
	// RSASSAPSSSHA384 is the key for algorithm "RSASSA-PSS-SHA384".
	RSASSAPSSSHA384 AlgorithmKey = "RSASSA-PSS-SHA384"
	// RSASSAPSSSHA512 is the key for algorithm "RSASSA-PSS-SHA512".
	RSASSAPSSSHA512 AlgorithmKey = "RSASSA-PSS-SHA512"
)

type CompletedConfig

type CompletedConfig struct {
	// Keys is list of keys and their attributes.
	Keys []VerifierKey
}

CompletedConfig is internal representation of the lakom coinfiguration.

type Config

type Config struct {
	PublicKeys []Key `json:"publicKeys"`
}

Config is the user facing structure of the configuration file. It contains list of keys.

func LoadConfig

func LoadConfig(filename string) (*Config, error)

LoadConfig reads and validates lakom configuration from given file path.

func (*Config) Complete

func (c *Config) Complete() (*CompletedConfig, error)

Complete transforms the user exposed config to the internal representation of the config.

type Key

type Key struct {
	// Name is a human readable name associated with the key.
	Name string `json:"name"`
	// Key is the public crypto key.
	Key string `json:"key"`
	// Algorithm describes how the signature verifier to be configured
	// with the given key.
	Algorithm AlgorithmKey `json:"algorithm,omitempty"`
}

Key contains a public crypto key used for signature verification. Attributes to the key are its name and the algorithm that should be used during signature verification.

type RSASchemeKey

type RSASchemeKey string

RSASchemeKey is key type alias for the RSA schemes.

const (
	// RSAPKCS1v15 is the key for scheme "RSASSA-PKCS1-v1_5".
	RSAPKCS1v15 RSASchemeKey = "RSASSA-PKCS1-v1_5"
	// RSASSAPSS is the key for scheme "RSASSA-PSS".
	RSASSAPSS RSASchemeKey = "RSASSA-PSS"
)

type VerifierKey

type VerifierKey struct {
	// Name is a human readable name associated with the key.
	Name string
	// Key is the public crypto key.
	Key crypto.PublicKey
	// Hash is the hash function that the verifier should use during signature verification.
	Hash *crypto.Hash
	// RSAScheme is the RSA scheme (if the key is of RSA type) the verifier to use during signature verification.
	RSAScheme *RSASchemeKey
}

VerifierKey contains a public crypto key used for signature verification. Attributes to the key are its name, optionally a hash function and RSA scheme that should be used during signature verification.

Jump to

Keyboard shortcuts

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