Documentation ¶
Overview ¶
Package sortedmap implements sorted and signed maps.
Index ¶
- Constants
- Variables
- type SignedMap
- type SortedMap
- func (so SortedMap) Image() []byte
- func (so SortedMap) Len() int
- func (so SortedMap) Less(i, j int) bool
- func (so SortedMap) Sign(signdate uint64, privKey *[ed25519.PrivateKeySize]byte) []byte
- func (so SortedMap) Swap(i, j int)
- func (so SortedMap) ToMap() StringMap
- func (so SortedMap) Verify(signdate uint64, publicKey []byte, signature []byte) bool
- type StringMap
- type StringStruct
Constants ¶
View Source
const MaxSignatureAge = 14400 // four hours
MaxSignatureAge is the maximum difference between now and the signature time.
Variables ¶
View Source
var ( // ErrNoVerify is returned when a signature could not be verified. ErrNoVerify = errors.New("sortedmap: signature verification failed") // ErrBadTime is returned if a signature time is either too old or too young. ErrBadTime = errors.New("sortedmap: signature time wrong") // ErrWalkBack is returned if an old certificate was presented. ErrWalkBack = errors.New("sortedmap: expired certificate replayed") )
Functions ¶
This section is empty.
Types ¶
type SignedMap ¶
SignedMap is a signed map.
type SortedMap ¶
type SortedMap []StringStruct
SortedMap is a sorted (or sortable) string->string representation.
func (SortedMap) Len ¶
Len returns the number of elements in the SortedMap. sort.Sort interface implementation.
func (SortedMap) Swap ¶
Swap swaps two elements in the SortedMap. sort.Sort interface implementation.
type StringMap ¶
StringMap is a string->string map.
func (StringMap) GenerateCertificate ¶
GenerateCertificate returns a signed and encoded SortedMap.
type StringStruct ¶
type StringStruct struct {
K, V string
}
StringStruct is a stringmap converted to struct.
Click to show internal directories.
Click to hide internal directories.