memstore

package
v0.0.0-...-30b4a77 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2016 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package memstore implements a key store in memory (for testing purposes).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemStore

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

MemStore implements the KeyStore interface in memory.

func New

func New() *MemStore

New returns a new MemStore.

func (*MemStore) AddPrivateKeyEntry

func (ms *MemStore) AddPrivateKeyEntry(ke *uid.KeyEntry)

AddPrivateKeyEntry adds private KeyEntry to memory store.

func (*MemStore) AddPublicKeyEntry

func (ms *MemStore) AddPublicKeyEntry(identity string, ke *uid.KeyEntry)

AddPublicKeyEntry adds public KeyEntry from identity to memory store.

func (*MemStore) AddSessionKey

func (ms *MemStore) AddSessionKey(
	hash, json, privKey string,
	cleanupTime uint64,
) error

AddSessionKey implemented in memory.

func (*MemStore) CleanupSessionKeys

func (ms *MemStore) CleanupSessionKeys(t uint64) error

CleanupSessionKeys implemented in memory.

func (*MemStore) DelMessageKey

func (ms *MemStore) DelMessageKey(
	sessionKey string,
	sender bool,
	msgIndex uint64,
) error

DelMessageKey implemented in memory.

func (*MemStore) DelPrivSessionKey

func (ms *MemStore) DelPrivSessionKey(hash string) error

DelPrivSessionKey implemented in memory.

func (*MemStore) GetChainKey

func (ms *MemStore) GetChainKey(sessionKey string) (*[32]byte, error)

GetChainKey implemented in memory.

func (*MemStore) GetMessageKey

func (ms *MemStore) GetMessageKey(
	sessionKey string,
	sender bool,
	msgIndex uint64,
) (*[64]byte, error)

GetMessageKey implemented in memory.

func (*MemStore) GetPrivateKeyEntry

func (ms *MemStore) GetPrivateKeyEntry(pubKeyHash string) (*uid.KeyEntry, error)

GetPrivateKeyEntry implemented in memory.

func (*MemStore) GetPublicKeyEntry

func (ms *MemStore) GetPublicKeyEntry(uidMsg *uid.Message) (*uid.KeyEntry, string, error)

GetPublicKeyEntry implemented in memory.

func (*MemStore) GetRootKeyHash

func (ms *MemStore) GetRootKeyHash(sessionKey string) (*[64]byte, error)

GetRootKeyHash implemented in memory.

func (*MemStore) GetSessionKey

func (ms *MemStore) GetSessionKey(hash string) (
	json, privKey string,
	err error,
)

GetSessionKey implemented in memory.

func (*MemStore) GetSessionState

func (ms *MemStore) GetSessionState(sessionStateKey string) (
	*session.State,
	error,
)

GetSessionState implemented in memory.

func (*MemStore) HasSession

func (ms *MemStore) HasSession(sessionKey string) bool

HasSession implemented in memory.

func (*MemStore) NumMessageKeys

func (ms *MemStore) NumMessageKeys(sessionKey string) (uint64, error)

NumMessageKeys implemented in memory.

func (*MemStore) SessionKey

func (ms *MemStore) SessionKey() string

SessionKey returns the most recent sessionKey in MemStore.

func (*MemStore) SetSessionState

func (ms *MemStore) SetSessionState(
	sessionStateKey string,
	sessionState *session.State,
) error

SetSessionState implemented in memory.

func (*MemStore) StoreSession

func (ms *MemStore) StoreSession(
	sessionKey, rootKeyHash, chainKey string,
	send, recv []string,
) error

StoreSession implemented in memory.

Jump to

Keyboard shortcuts

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