trustedtimestamps: mae.earth/pkg/trustedtimestamps Index | Files | Directories

package trustedtimestamps

import "mae.earth/pkg/trustedtimestamps"

mae.earth/pkg/trustedtimestamps/client.go
* mae 12017

mae.earth/pkg/trustedtimestamps/definitions.go
* mae 12017

mae.earth/pkg/trustedtimestamps/funcs.go
* mae 12017

mae.earth/pkg/trustedtimestamps/server.go
* mae 12017

mae.earth/pkg/trustedtimestamps/timestamps.go
* mae 12017

Package trustedtimestamps

mae.earth/pkg/trustedtimestamps/utils.go
* mae 12017

Index

Package Files

client.go definitions.go funcs.go server.go timestamps.go utils.go

Constants

const (
    BannerType = "TRUSTED TIMESTAMP BANNER"
)
const (
    TimestampFormat = time.RFC1123Z
)

Variables

var (
    ErrNoKey                = errors.New("No Key")
    ErrInvalidBanner        = errors.New("Invalid Banner")
    ErrBlockIsEncrypted     = errors.New("Block is Encrypted")
    ErrInvalidBlockType     = errors.New("Invalid block type")
    ErrBadKeyType           = errors.New("Bad Key Type")
    ErrBadKey               = errors.New("Bad Key")
    ErrAlreadyPresent       = errors.New("Already Present")
    ErrInvalidTimestamp     = errors.New("Invalid Timestamp")
    ErrEmptyKeychain        = errors.New("Empty Keychain")
    ErrUnknownSource        = errors.New("Unknown Source")
    ErrRequireConfiguration = errors.New("Require Configuration")
    ErrInvalidHashFunc      = errors.New("Invalid Hash Function")
)
var (
    ErrEmptyDataHash     = errors.New("Empty Data Hash")
    ErrInvalidPrivateKey = errors.New("Invalid Private Key")
    ErrInvalidPublicKey  = errors.New("Invalid Public Key")
)
var (
    Delimiter = []byte(":")
)

func ArmourTimestamps Uses

func ArmourTimestamps(timestamps []*Timestamp) [][]byte

ArmourTimestamps

func CompressArmoured Uses

func CompressArmoured(armoured [][]byte) ([][]byte, error)

CompressArmoured

func EqualsFingerprint Uses

func EqualsFingerprint(pub *ecdsa.PublicKey, fnger [20]byte) bool

EqualsFingerprint

func Fingerprint Uses

func Fingerprint(pub *ecdsa.PublicKey) ([20]byte, error)

Fingerprint

func Fuzz Uses

func Fuzz(data []byte) int

Fuzz see https://github.com/dvyukov/go-fuzz

func TimestampArmourCompress Uses

func TimestampArmourCompress(datahash []byte, source string, prv *ecdsa.PrivateKey) ([]byte, error)

TimestampArmourCompress

func UncompressArmoured Uses

func UncompressArmoured(armoured [][]byte) ([][]byte, error)

UncompressArmoured

func VerifyTimestamp Uses

func VerifyTimestamp(timestamp *Timestamp, pub *ecdsa.PublicKey) bool

VerifyTimestamp

type Client Uses

type Client struct {
    // contains filtered or unexported fields
}

Client

func NewClient Uses

func NewClient(conf *Configuration) (*Client, error)

NewClient

func (*Client) AddToKeychain Uses

func (client *Client) AddToKeychain(data []byte) error

TODO: replace source with server options structure

func (*Client) KnownFingerprints Uses

func (client *Client) KnownFingerprints() []string

KnownFingerprints

func (*Client) Prepare Uses

func (client *Client) Prepare(data []byte) []byte

Prepare

func (*Client) RemoveFromKeychain Uses

func (client *Client) RemoveFromKeychain(fingerprint [20]byte) error

RemoveFromKeychain

func (*Client) Stat Uses

func (client *Client) Stat() Stat

Stat

func (*Client) Verify Uses

func (client *Client) Verify(timestamp *Timestamp) (bool, error)

Verify

type Configuration Uses

type Configuration struct {

    /* TODO: add in the hash functions etc */
    Domain string

    Hash string
}

type HashFunc Uses

type HashFunc func([]byte) []byte

type Server Uses

type Server struct {
    // contains filtered or unexported fields
}

Server

func NewServer Uses

func NewServer(conf *Configuration) (*Server, error)

NewServer

func (*Server) ExportBanner Uses

func (server *Server) ExportBanner() ([]byte, error)

ExportBanner

func (*Server) GenerateKey Uses

func (server *Server) GenerateKey() error

GenerateKey

func (*Server) HaveKey Uses

func (server *Server) HaveKey() bool

HaveKey

func (*Server) Key Uses

func (server *Server) Key() *ecdsa.PrivateKey

Key

func (*Server) Stat Uses

func (server *Server) Stat() Stat

func (*Server) Timestamp Uses

func (server *Server) Timestamp(datahash []byte) (*Timestamp, error)

Timstamp

func (*Server) UseKey Uses

func (server *Server) UseKey(prv *ecdsa.PrivateKey) error

UseKey

type ServerBanner Uses

type ServerBanner struct {
    Source      string
    Fingerprint [20]byte
    PublicKey   *ecdsa.PublicKey
}

type Stat Uses

type Stat struct {
    Requests int
}

type Timestamp Uses

type Timestamp struct {
    Headers map[string]string /* comma seperated tags, hash = sha1,delimited */

    Source    string
    DataHash  []byte
    Hash      []byte
    Timestamp time.Time

    Fingerprint [20]byte
    Signature   []byte
}

Timestamp

func CreateTimestamp Uses

func CreateTimestamp(datahash []byte, source string, prv *ecdsa.PrivateKey, hashfunc HashFunc) (*Timestamp, error)

CreateTimestamp -- TODO: adds an options structure for setting hash functions etc

func DearmourTimestamps Uses

func DearmourTimestamps(armours [][]byte) ([]*Timestamp, error)

DearmourTimestamps

func NewTimestamp Uses

func NewTimestamp(datahash []byte, source string, prv *ecdsa.PrivateKey) (*Timestamp, error)

FIXME: not used anymore -- see CreateTimestamp instead

func (*Timestamp) Armour Uses

func (ts *Timestamp) Armour() []byte

func (*Timestamp) Equals Uses

func (ts *Timestamp) Equals(o *Timestamp) bool

func (*Timestamp) String Uses

func (ts *Timestamp) String() string

Directories

PathSynopsis
example

Package trustedtimestamps imports 16 packages (graph). Updated 2018-11-08. Refresh now. Tools for package owners.