Documentation ¶
Index ¶
- func Chain(w io.Writer, s *config.ServersJSON, nonce []byte) error
- func FetchRoughtime(s *Server, nonce []byte) (m time.Time, r time.Duration, err error)
- func LoadChain(r io.Reader) (*config.Chain, error)
- func ParseResponse(resp, nonce []byte, root ed25519.PublicKey) (m time.Time, r time.Duration, err error)
- func ReadServersJSON(r io.Reader) (*config.ServersJSON, error)
- func VerifyChain(c *config.Chain, s *config.ServersJSON) error
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chain ¶
Chain runs a chain of request against a list of servers and stores the result as JSON in w.
func FetchRoughtime ¶
FetchRoughtime fetches the current time from the given server, using the given nonce. Nonce has to be 64 bytes long or nil, in which case a random nonce is generated. The server response is verified and any verification error is returned.
func ParseResponse ¶
func ParseResponse(resp, nonce []byte, root ed25519.PublicKey) (m time.Time, r time.Duration, err error)
ParseResponse parses a roughtime response and validates it against the given nonce and root key. Any validation error is returned.
func ReadServersJSON ¶
func ReadServersJSON(r io.Reader) (*config.ServersJSON, error)
ReadServersJSON reads a servers.json from r.
func VerifyChain ¶
func VerifyChain(c *config.Chain, s *config.ServersJSON) error
VerifyChain verifies the given chain against the list of servers and outputs any validation errors.
Types ¶
Click to show internal directories.
Click to hide internal directories.