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 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 SupportedVersions
- type TrustedKey
- type TrustedKeysFile
Constants ¶
View Source
const ( ConfigVersionV1 = 1 AuthVersionV1 = 1 AlgEd25519 = "ed25519" )
Variables ¶
This section is empty.
Functions ¶
func CanonicalPayloadV1 ¶
func DecodeBase64Fixed ¶
func SignedPayloadHash ¶
func ValidateRoundID ¶
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 SupportedVersions ¶
type TrustedKey ¶
type TrustedKeysFile ¶
type TrustedKeysFile struct {
TrustedKeys []TrustedKey `json:"trusted_keys"`
}
Click to show internal directories.
Click to hide internal directories.