Documentation
¶
Index ¶
- Constants
- func CanonicalPayloadV1(eaPK [32]byte) []byte
- func DecodeBase64Fixed(s string, expectedLen int, field string) ([]byte, error)
- func DecodeHexFixed(s string, expectedLen int, field string) ([]byte, error)
- func SignV1(priv ed25519.PrivateKey, eaPK [32]byte) []byte
- func SignedPayloadHash(payload []byte) [32]byte
- func ValidateRoundID(roundID string) error
- func ValidateStaticConfig(cfg *StaticConfig) error
- func ValidateWrapper(cfg *SignedConfig) error
- func VerifyEntrySignatures(entry RoundEntry, trusted []TrustedKey) bool
- func VerifyV1(pub ed25519.PublicKey, eaPK [32]byte, sig []byte) bool
- type AuthStatus
- type Endpoint
- type RoundEntry
- type Signature
- type SignedConfig
- type StaticConfig
- type SupportedVersions
- type TrustedKey
Constants ¶
View Source
const ( ConfigVersionV1 = 1 StaticConfigVersionV1 = 1 AuthVersionV1 = 1 AlgEd25519 = "ed25519" )
Variables ¶
This section is empty.
Functions ¶
func CanonicalPayloadV1 ¶
func DecodeBase64Fixed ¶
func SignedPayloadHash ¶
func ValidateRoundID ¶
func ValidateStaticConfig ¶ added in v0.5.52
func ValidateStaticConfig(cfg *StaticConfig) error
func ValidateWrapper ¶
func ValidateWrapper(cfg *SignedConfig) error
func VerifyEntrySignatures ¶
func VerifyEntrySignatures(entry RoundEntry, trusted []TrustedKey) bool
Types ¶
type AuthStatus ¶
type AuthStatus string
const ( AuthAuthenticated AuthStatus = "authenticated" AuthMissingRound AuthStatus = "missing_round" AuthUnknownVersion AuthStatus = "unknown_auth_version" AuthInvalidSignatures AuthStatus = "invalid_signatures" AuthEaPKMismatch AuthStatus = "ea_pk_mismatch" )
func Authenticate ¶
func Authenticate(cfg *SignedConfig, trusted []TrustedKey, roundID string, eaPKFromChain [32]byte) AuthStatus
type RoundEntry ¶
type SignedConfig ¶
type SignedConfig struct {
ConfigVersion int `json:"config_version"`
VoteServers []Endpoint `json:"vote_servers"`
PIREndpoints []Endpoint `json:"pir_endpoints"`
SupportedVersions SupportedVersions `json:"supported_versions"`
Rounds map[string]RoundEntry `json:"rounds"`
}
type StaticConfig ¶ added in v0.5.52
type StaticConfig struct {
StaticConfigVersion int `json:"static_config_version"`
DynamicConfigURL string `json:"dynamic_config_url"`
TrustedKeys []TrustedKey `json:"trusted_keys"`
}
type SupportedVersions ¶
Click to show internal directories.
Click to hide internal directories.