client

package
v0.0.0-...-1e6caf6 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchCertificate

func FetchCertificate(url string) (x509.Certificate, error)

Get the x509 certificate from the given url

func FetchClientUpdate

func FetchClientUpdate(url string) (monitor.ClientUpdate, error)

Fetch an entity from the given url and parse it as a client update object

func GetRootHash

func GetRootHash(data MonitorData) []string

func Get_SRH_and_DCRV

func Get_SRH_and_DCRV(rev definition.Gossip_object) (string, bitset.BitSet)

func LoadCRVDatabase

func LoadCRVDatabase(ctx *ClientContext)

func LoadPoMdatabase

func LoadPoMdatabase(ctx *ClientContext)

func LoadSTHDatabase

func LoadSTHDatabase(ctx *ClientContext)

func SaveCRVDatabase

func SaveCRVDatabase(ctx *ClientContext)

func SavePomDatabase

func SavePomDatabase(ctx *ClientContext)

func SaveSTHDatabase

func SaveSTHDatabase(ctx *ClientContext)

Types

type ClientConfig

type ClientConfig struct {
	Monitor_URLs []string
	//This is the URL of the monitor where the client will get the information from
	Client_URL           string
	Port                 string
	MMD                  int
	MRD                  int
	STH_Storage_filepath string
	CRV_Storage_filepath string
	PoM_Store_filepath   string
}

type ClientContext

type ClientContext struct {
	Config              *ClientConfig
	Crypto              *crypto.CryptoConfig
	Current_Monitor_URL string
	// the databases are shared resources and should be protected with mutex
	STH_database  map[string]string         // key = entity_ID + @ + Period, content = RootHash
	CRV_database  map[string]*bitset.BitSet // key = entity_ID, content = CRV
	POM_database  map[string]definition.Gossip_object
	STH_DB_RWLock *sync.RWMutex
	CRV_DB_RWLock *sync.RWMutex
	POM_DB_RWLock *sync.RWMutex
	// Don't need lock for monitor integerity DB because it is only checked once per period
	Config_filepath string
	Crypto_filepath string
	Status          string
}

func (*ClientContext) HandleUpdate

func (ctx *ClientContext) HandleUpdate(update monitor.ClientUpdate, verify bool, newmonitor bool) bool

func (*ClientContext) InitializeClientContext

func (ctx *ClientContext) InitializeClientContext()

func (*ClientContext) LoadUpdate

func (ctx *ClientContext) LoadUpdate(filepath string) monitor.ClientUpdate

func (*ClientContext) VerifyCTngextension

func (ctx *ClientContext) VerifyCTngextension(cert *x509.Certificate) bool

func (*ClientContext) VerifySRH

func (ctx *ClientContext) VerifySRH(srh string, dCRV *bitset.BitSet, CAID string, Period string) bool

type MonitorData

type MonitorData = []definition.Gossip_object

func FetchGossip

func FetchGossip(url string) (MonitorData, error)

Fetch an entity from the given url and parse it as an array of gossip objects

Jump to

Keyboard shortcuts

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