service

package
v0.0.0-...-3a38687 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: AGPL-3.0 Imports: 8 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(authpubsJson 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 InitAbeService

func InitAbeService(config Config, abeStorage Storage)

func NewRandomSecret

func NewRandomSecret(orgStr 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, seed 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 ActiveConf

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

type ArithmeticConf

type ArithmeticConf struct {
	Library string `yaml:"library"`
	Curve   string `yaml:"curve"`
	Seed    string `yaml:"seed"`
}

type Config

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

type Ext

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

func ReadConfig

func ReadConfig(filename string) Ext

type LeveldbConf

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

type RedisConf

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

type Storage

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

type StorageConf

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

type StorageLeveldb

type StorageLeveldb struct{}

func (StorageLeveldb) Get

func (abeStorage StorageLeveldb) Get(key string) string

get

func (StorageLeveldb) Init

func (abeStorage StorageLeveldb) Init(config Config)

init

func (StorageLeveldb) Scan

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

scan

func (StorageLeveldb) Set

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

set

type StorageRedis

type StorageRedis struct{}

func (StorageRedis) Get

func (abeStorage StorageRedis) Get(key string) string

get

func (StorageRedis) Init

func (abeStorage StorageRedis) Init(config Config)

init

func (StorageRedis) Scan

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

scan

func (StorageRedis) Set

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

set

Jump to

Keyboard shortcuts

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