spec

package
v0.0.0-...-e6b0e8f Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExpired = errors.New("canary has expired")

Functions

This section is empty.

Types

type Canary

type Canary []byte

func (Canary) IsValidDate

func (m Canary) IsValidDate(t time.Time) error

IsValidDate validates canary's issue date. Unlike Validate method, IsValidDate checks only existence of date and its validity against provided time. Phrases defined in OMG specification are not checked. Returns nil if canary is valid.

func (Canary) Validate

func (m Canary) Validate(t time.Time) error

Validate validates canary message. It looks for existence of mandatory phrases within the signed message, a Bitcoin block and a date. It parses the date and checks if the message is valid for given time period. Returns nil if canary is valid.

func (Canary) VerifySignature

func (m Canary) VerifySignature(keyRing openpgp.KeyRing) (*openpgp.Entity, error)

VerifySignature verifies signature of the signed message. If message's signature matches a key in keyRing, it returns an identity of the key holder.

type Mirrors

type Mirrors []byte

func (Mirrors) List

func (m Mirrors) List() ([]string, error)

List returns a list of mirrors found in the signed message.

func (Mirrors) VerifySignature

func (m Mirrors) VerifySignature(keyRing openpgp.KeyRing) (*openpgp.Entity, error)

VerifySignature verifies signature of the signed message. If message's signature matches a key in keyRing, it returns an identity of the key holder.

Jump to

Keyboard shortcuts

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