Documentation
¶
Overview ¶
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 ¶
- Constants
- Variables
- func ArmourTimestamps(timestamps []*Timestamp) [][]byte
- func CompressArmoured(armoured [][]byte) ([][]byte, error)
- func EqualsFingerprint(pub *ecdsa.PublicKey, fnger [20]byte) bool
- func Fingerprint(pub *ecdsa.PublicKey) ([20]byte, error)
- func Fuzz(data []byte) int
- func TimestampArmourCompress(datahash []byte, source string, prv *ecdsa.PrivateKey) ([]byte, error)
- func UncompressArmoured(armoured [][]byte) ([][]byte, error)
- func VerifyTimestamp(timestamp *Timestamp, pub *ecdsa.PublicKey) bool
- type Client
- func (client *Client) AddToKeychain(data []byte) error
- func (client *Client) KnownFingerprints() []string
- func (client *Client) Prepare(data []byte) []byte
- func (client *Client) RemoveFromKeychain(fingerprint [20]byte) error
- func (client *Client) Stat() Stat
- func (client *Client) Verify(timestamp *Timestamp) (bool, error)
- type Configuration
- type HashFunc
- type Server
- func (server *Server) ExportBanner() ([]byte, error)
- func (server *Server) GenerateKey() error
- func (server *Server) HaveKey() bool
- func (server *Server) Key() *ecdsa.PrivateKey
- func (server *Server) Stat() Stat
- func (server *Server) Timestamp(datahash []byte) (*Timestamp, error)
- func (server *Server) UseKey(prv *ecdsa.PrivateKey) error
- type ServerBanner
- type Stat
- type Timestamp
Constants ¶
View Source
const (
BannerType = "TRUSTED TIMESTAMP BANNER"
)
View Source
const (
TimestampFormat = time.RFC1123Z
)
Variables ¶
View Source
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") )
View Source
var ( ErrEmptyDataHash = errors.New("Empty Data Hash") ErrInvalidPrivateKey = errors.New("Invalid Private Key") ErrInvalidPublicKey = errors.New("Invalid Public Key") )
View Source
var (
Delimiter = []byte(":")
)
Functions ¶
func EqualsFingerprint ¶
EqualsFingerprint
func TimestampArmourCompress ¶
TimestampArmourCompress
func UncompressArmoured ¶
UncompressArmoured
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client
func (*Client) AddToKeychain ¶
TODO: replace source with server options structure
func (*Client) KnownFingerprints ¶
KnownFingerprints
func (*Client) RemoveFromKeychain ¶
RemoveFromKeychain
type Configuration ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server
type ServerBanner ¶
type Timestamp ¶
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 ¶
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 ¶
DearmourTimestamps
func NewTimestamp ¶
FIXME: not used anymore -- see CreateTimestamp instead
Source Files
¶
Click to show internal directories.
Click to hide internal directories.