service

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchAuthPrv

func FetchAuthPrv(authStr string) string

fetch AuthPrv json object from key prv:auth:<authStr>

func FetchAuthPub

func FetchAuthPub(authStr string) string

fetch AuthPub json object from key pub:auth:<authStr>

func FetchAuthPubs

func FetchAuthPubs(auths_json string) string

fetch authorities public keys

func FetchCurve

func FetchCurve(curveStr string) string

fetch Curve json object from key pub:curve:<curveStr>

func FetchOrg

func FetchOrg(orgStr string) string

fetch Org json object from key pub:org:<orgStr>

func FetchUserAttrs

func FetchUserAttrs(user string) string

fetch UserAttrs json object scanning for keys of the form prv:userkey:<user>:*

func FetchUserkey

func FetchUserkey(user string, attr string) string

fetch Userkey json object from key prv:userkey:<user>:<attr>

func FetchUserkeys

func FetchUserkeys(userattrsJson string) string

fetch Userkeys json object from keys of the form prv:userkey:<user>:<attr>

func GetCurve

func GetCurve(curveStr string) string

generate new curve and stores it

func InitAbeService

func InitAbeService(config Config, abeServiceStorage AbeServiceStorage)

func NewRandomSecret

func NewRandomSecret(orgStr string, seed string) string

generate new random secret for an organization

func SetupAuth

func SetupAuth(authStr string, orgStr string) string

generate new authority (private and public params) and stores it

func SetupOrg

func SetupOrg(orgStr string, lib string, curveStr string) string

generate new organization and stores it

func SetupUserkey

func SetupUserkey(user string, attr string) string

generate new user key and stores it

func StoreAuthPrv

func StoreAuthPrv(authStr string, authprvJson string)

store AuthPrv json object in key prv:auth:<authStr>

func StoreAuthPub

func StoreAuthPub(authStr string, authpub_json string)

store AuthPub json object in key pub:auth:<authStr>

func StoreCurve

func StoreCurve(curveStr string, curveJson string)

store Curve json object in key pub:curve:<curveStr>

func StoreOrg

func StoreOrg(orgStr string, orgJson string)

store Org json object in key pub:org:<orgStr>

func StoreUserkey

func StoreUserkey(user string, attr string, userkey_json string)

store Userkey json object in key prv:userkey:<user>:<attr>

Types

type AbeServiceStorage

type AbeServiceStorage interface {
	Init(config Config)
	Set(key string, value string)
	Get(key string) string
	Scan(key string) []string
}

type AbeServiceStorageLeveldb

type AbeServiceStorageLeveldb struct{}

func (AbeServiceStorageLeveldb) Get

func (abeStorage AbeServiceStorageLeveldb) Get(key string) string

get

func (AbeServiceStorageLeveldb) Init

func (abeStorage AbeServiceStorageLeveldb) Init(config Config)

init

func (AbeServiceStorageLeveldb) Scan

func (abeStorage AbeServiceStorageLeveldb) Scan(key string) []string

scan

func (AbeServiceStorageLeveldb) Set

func (abeStorage AbeServiceStorageLeveldb) Set(key string, value string)

set

type AbeServiceStorageRedis

type AbeServiceStorageRedis struct{}

func (AbeServiceStorageRedis) Get

func (abeStorage AbeServiceStorageRedis) Get(key string) string

get

func (AbeServiceStorageRedis) Init

func (abeStorage AbeServiceStorageRedis) Init(config Config)

init

func (AbeServiceStorageRedis) Scan

func (abeStorage AbeServiceStorageRedis) Scan(key string) []string

scan

func (AbeServiceStorageRedis) Set

func (abeStorage AbeServiceStorageRedis) Set(key string, value string)

set

type Active

type Active struct {
	Type  string `yaml:"type"`
	Label string `yaml:"label"`
}

type Arithmetic

type Arithmetic struct {
	Curve   string `yaml:"curve"`
	Library string `yaml:"library"`
}

type Config

type Config struct {
	Arithmetic Arithmetic `yaml:"arithmetic"`
	Storage    Storage    `yaml:"storage"`
	Active     Active     `yaml:"active"`
}

type Ext

type Ext struct {
	Config Config `yaml:"config"`
}

func ReadConfig

func ReadConfig(filename string) Ext

type Leveldb

type Leveldb struct {
	Name string `yaml:"name"`
}

type Redis

type Redis struct {
	Addr     string `yaml:"addr"`
	Password string `yaml:"password"`
}

type Storage

type Storage struct {
	Redis   map[string]Redis   `yaml:"redis"`
	Leveldb map[string]Leveldb `yaml:"leveldb"`
}

Jump to

Keyboard shortcuts

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