Documentation ¶
Index ¶
- Variables
- type BadgerKeyStore
- func (ks *BadgerKeyStore) Addresses() (types.Set[types.Address], error)
- func (ks *BadgerKeyStore) Close() error
- func (ks *BadgerKeyStore) DefaultPublicIdentity() (_ Identity, err error)
- func (ks *BadgerKeyStore) ExtraUserData(key string) (interface{}, bool, error)
- func (ks *BadgerKeyStore) Identities() (_ []Identity, err error)
- func (ks *BadgerKeyStore) IdentityExists(address types.Address) (_ bool, err error)
- func (ks *BadgerKeyStore) IdentityWithAddress(address types.Address) (_ Identity, err error)
- func (ks *BadgerKeyStore) LocalSymEncKey() crypto.SymEncKey
- func (ks *BadgerKeyStore) Mnemonic() (string, error)
- func (ks *BadgerKeyStore) NewIdentity(public bool) (_ Identity, err error)
- func (ks *BadgerKeyStore) OpenMessageFrom(usingIdentity types.Address, senderPublicKey *crypto.AsymEncPubkey, ...) (_ []byte, err error)
- func (ks *BadgerKeyStore) PublicIdentities() (_ []Identity, err error)
- func (ks *BadgerKeyStore) SaveExtraUserData(key string, value interface{}) error
- func (ks *BadgerKeyStore) SealMessageFor(usingIdentity types.Address, recipientPubKey *crypto.AsymEncPubkey, msg []byte) (_ []byte, err error)
- func (ks *BadgerKeyStore) SignHash(usingIdentity types.Address, data types.Hash) (_ []byte, err error)
- func (ks *BadgerKeyStore) SymmetricallyDecrypt(ciphertext crypto.SymEncMsg) ([]byte, error)
- func (ks *BadgerKeyStore) SymmetricallyEncrypt(plaintext []byte) (crypto.SymEncMsg, error)
- func (ks *BadgerKeyStore) Unlock(password string, userMnemonic string) (err error)
- func (ks *BadgerKeyStore) VerifySignature(usingIdentity types.Address, hash types.Hash, signature []byte) (_ bool, err error)
- type Identity
- type KeyStore
- type ScryptParams
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultScryptParams = ScryptParams{N: keystore.StandardScryptN, P: keystore.StandardScryptP} InsecureScryptParams = ScryptParams{N: 2, P: 1} )
Functions ¶
This section is empty.
Types ¶
type BadgerKeyStore ¶
func NewBadgerKeyStore ¶
func NewBadgerKeyStore(badgerOpts badger.Options, scryptParams ScryptParams) *BadgerKeyStore
func (*BadgerKeyStore) Close ¶
func (ks *BadgerKeyStore) Close() error
func (*BadgerKeyStore) DefaultPublicIdentity ¶
func (ks *BadgerKeyStore) DefaultPublicIdentity() (_ Identity, err error)
func (*BadgerKeyStore) ExtraUserData ¶
func (ks *BadgerKeyStore) ExtraUserData(key string) (interface{}, bool, error)
func (*BadgerKeyStore) Identities ¶
func (ks *BadgerKeyStore) Identities() (_ []Identity, err error)
func (*BadgerKeyStore) IdentityExists ¶
func (ks *BadgerKeyStore) IdentityExists(address types.Address) (_ bool, err error)
func (*BadgerKeyStore) IdentityWithAddress ¶
func (ks *BadgerKeyStore) IdentityWithAddress(address types.Address) (_ Identity, err error)
func (*BadgerKeyStore) LocalSymEncKey ¶
func (ks *BadgerKeyStore) LocalSymEncKey() crypto.SymEncKey
func (*BadgerKeyStore) Mnemonic ¶
func (ks *BadgerKeyStore) Mnemonic() (string, error)
func (*BadgerKeyStore) NewIdentity ¶
func (ks *BadgerKeyStore) NewIdentity(public bool) (_ Identity, err error)
func (*BadgerKeyStore) OpenMessageFrom ¶
func (ks *BadgerKeyStore) OpenMessageFrom(usingIdentity types.Address, senderPublicKey *crypto.AsymEncPubkey, msgEncrypted []byte) (_ []byte, err error)
func (*BadgerKeyStore) PublicIdentities ¶
func (ks *BadgerKeyStore) PublicIdentities() (_ []Identity, err error)
func (*BadgerKeyStore) SaveExtraUserData ¶
func (ks *BadgerKeyStore) SaveExtraUserData(key string, value interface{}) error
func (*BadgerKeyStore) SealMessageFor ¶
func (ks *BadgerKeyStore) SealMessageFor(usingIdentity types.Address, recipientPubKey *crypto.AsymEncPubkey, msg []byte) (_ []byte, err error)
func (*BadgerKeyStore) SymmetricallyDecrypt ¶
func (ks *BadgerKeyStore) SymmetricallyDecrypt(ciphertext crypto.SymEncMsg) ([]byte, error)
func (*BadgerKeyStore) SymmetricallyEncrypt ¶
func (ks *BadgerKeyStore) SymmetricallyEncrypt(plaintext []byte) (crypto.SymEncMsg, error)
func (*BadgerKeyStore) Unlock ¶
func (ks *BadgerKeyStore) Unlock(password string, userMnemonic string) (err error)
Loads the user's keys from the DB and decrypts them.
func (*BadgerKeyStore) VerifySignature ¶
type Identity ¶
type Identity struct { Public bool SigKeypair *crypto.SigKeypair AsymEncKeypair *crypto.AsymEncKeypair }
type KeyStore ¶
type KeyStore interface { Unlock(password string, userMnemonic string) error Close() error Mnemonic() (string, error) Identities() ([]Identity, error) Addresses() (types.Set[types.Address], error) PublicIdentities() ([]Identity, error) DefaultPublicIdentity() (Identity, error) IdentityWithAddress(address types.Address) (Identity, error) IdentityExists(address types.Address) (bool, error) NewIdentity(public bool) (Identity, error) SignHash(usingIdentity types.Address, data types.Hash) ([]byte, error) VerifySignature(usingIdentity types.Address, hash types.Hash, signature []byte) (bool, error) SealMessageFor(usingIdentity types.Address, recipientPubKey *crypto.AsymEncPubkey, msg []byte) ([]byte, error) OpenMessageFrom(usingIdentity types.Address, senderPublicKey *crypto.AsymEncPubkey, msgEncrypted []byte) ([]byte, error) LocalSymEncKey() crypto.SymEncKey ExtraUserData(key string) (interface{}, bool, error) SaveExtraUserData(key string, value interface{}) error }
type ScryptParams ¶
type ScryptParams struct{ N, P int }
Click to show internal directories.
Click to hide internal directories.