Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppInfo ¶
type AppInfo struct { Application string `json:"application"` AppIdentifier string `json:"appIdentifier"` Version string `json:"version"` }
AppInfo is a helper structure that contains information about the application that uses these credentials
type AppKeystore ¶
type AppKeystore struct { Application string `json:"application"` AppIdentifier string `json:"appIdentifier"` Credentials map[Key]appKeystoreCredential `json:"credentials"` Version string `json:"version"` // contains filtered or unexported fields }
AppKeystore represents the membership credentials to be used in RLN
func (*AppKeystore) AddMembershipCredentials ¶ added in v0.8.0
func (k *AppKeystore) AddMembershipCredentials(newCredential MembershipCredentials, password string) error
AddMembershipCredentials inserts a membership credential to the keystore matching the application, appIdentifier and version filters.
func (*AppKeystore) GetMembershipCredentials ¶ added in v0.8.0
func (k *AppKeystore) GetMembershipCredentials(keystorePassword string, index *rln.MembershipIndex, filterMembershipContract MembershipContractInfo) (*MembershipCredentials, error)
GetMembershipCredentials decrypts and retrieves membership credentials from the keystore applying filters
type ChainID ¶ added in v0.8.0
ChainID is a helper struct created to comply with the expected marshalling for the credentials
func (ChainID) MarshalJSON ¶ added in v0.8.0
MarshalJSON is used to convert a ChainID into a valid value expected by the json encoder
func (ChainID) String ¶ added in v0.8.0
String returns a string with the expected chainId format for the credentials
func (*ChainID) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON converts a byte slice into a ChainID
type ContractAddress ¶ added in v0.8.0
ContractAddress is a common.Address created to comply with the expected marshalling for the credentials
func (ContractAddress) MarshalText ¶ added in v0.8.0
func (c ContractAddress) MarshalText() ([]byte, error)
MarshalText is used to convert a ContractAddress into a valid value expected by the json encoder
func (*ContractAddress) UnmarshalText ¶ added in v0.8.0
func (c *ContractAddress) UnmarshalText(text []byte) error
UnmarshalText converts a byte slice into a ContractAddress
type Key ¶ added in v0.8.0
type Key string
Key is a helper type created to represent the key in a map of credentials
type MembershipContractInfo ¶ added in v0.8.0
type MembershipContractInfo struct { ChainID ChainID `json:"chainId"` Address ContractAddress `json:"address"` }
MembershipContractInfo contains information about a membership smart contract address and the chain in which it is deployed
func NewMembershipContractInfo ¶ added in v0.8.0
func NewMembershipContractInfo(chainID *big.Int, address common.Address) MembershipContractInfo
NewMembershipContractInfo generates a new MembershipContract instance
func (MembershipContractInfo) Equals ¶ added in v0.8.0
func (m MembershipContractInfo) Equals(other MembershipContractInfo) bool
Equals is used to compare MembershipContract
type MembershipCredentials ¶
type MembershipCredentials struct { IdentityCredential *rln.IdentityCredential `json:"identityCredential"` MembershipContractInfo MembershipContractInfo `json:"membershipContract"` TreeIndex rln.MembershipIndex `json:"treeIndex"` }
MembershipCredentials contains all the information about an RLN Identity Credential and membership group it belongs to
func (MembershipCredentials) Equals ¶
func (m MembershipCredentials) Equals(other MembershipCredentials) bool
Equals is used to compare MembershipCredentials