keystore

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSeparator = "\n"
View Source
const RLN_CREDENTIALS_FILENAME = "rlnCredentials.json"
View Source
const RLN_CREDENTIALS_PASSWORD = "password"

Variables

This section is empty.

Functions

func AddMembershipCredentials

func AddMembershipCredentials(path string, credentials []MembershipCredentials, password string, appInfo AppInfo, separator string) error

Adds a sequence of membership credential to the keystore matching the application, appIdentifier and version filters.

func CreateAppKeystore

func CreateAppKeystore(path string, appInfo AppInfo, separator string) error

Types

type AppInfo

type AppInfo struct {
	Application   string `json:"application"`
	AppIdentifier string `json:"appIdentifier"`
	Version       string `json:"version"`
}

type AppKeystore

type AppKeystore struct {
	Application   string                `json:"application"`
	AppIdentifier string                `json:"appIdentifier"`
	Credentials   []keystore.CryptoJSON `json:"credentials"`
	Version       string                `json:"version"`
}

func LoadAppKeystore

func LoadAppKeystore(path string, appInfo AppInfo, separator string) (AppKeystore, error)

type MembershipContract

type MembershipContract struct {
	ChainId string `json:"chainId"`
	Address string `json:"address"`
}

func (MembershipContract) Equals

func (m MembershipContract) Equals(other MembershipContract) bool

type MembershipCredentials

type MembershipCredentials struct {
	IdentityCredential rln.IdentityCredential `json:"identityCredential"`
	MembershipGroups   []MembershipGroup      `json:"membershipGroups"`
}

func GetMembershipCredentials

func GetMembershipCredentials(logger *zap.Logger, credentialsPath string, password string, appInfo AppInfo, filterIdentityCredentials []MembershipCredentials, filterMembershipContracts []MembershipContract) ([]MembershipCredentials, error)

func (MembershipCredentials) Equals

type MembershipGroup

type MembershipGroup struct {
	MembershipContract MembershipContract  `json:"membershipContract"`
	TreeIndex          rln.MembershipIndex `json:"treeIndex"`
}

func (MembershipGroup) Equals

func (m MembershipGroup) Equals(other MembershipGroup) bool

Jump to

Keyboard shortcuts

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