identity

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeystore

func GenerateKeystore(privKeyBytes, passwd []byte) ([]byte, error)

GenerateKeystore generate keystore file by json

func GeneratePrivateKey

func GeneratePrivateKey() ([]byte, error)

GeneratePrivateKey generate random private key

func InspectKeystore

func InspectKeystore(keyjson, passwd []byte) ([]byte, error)

Types

type Address

type Address common.Address

func BytesToAddress

func BytesToAddress(bytes []byte) Address

func Ecrecover

func Ecrecover(b []byte, sig []byte) (Address, error)

func HexToAddress

func HexToAddress(s string) Address

func (Address) Hex

func (addr Address) Hex() string

type DID

type DID struct {
	// contains filtered or unexported fields
}

func CreateKeystoreArrayAndSaveLocal

func CreateKeystoreArrayAndSaveLocal(keyDir string, passwd, salt []byte, cnt int) ([]*DID, error)

CreateKeystoreArrayAndSaveLocal used to generate some keystore and save to local path for start up test

func New

func New() (*DID, error)

func UnlockKeystoreArray

func UnlockKeystoreArray(keyDir string, passwd, salt []byte) ([]*DID, error)

func (*DID) GetAddress

func (d *DID) GetAddress() Address

func (*DID) GetKey

func (d *DID) GetKey() *keystore.Key

func (*DID) Inspect

func (d *DID) Inspect(showPrivate bool) (addr string, pubKey string, privKey string, err error)

func (*DID) LoadECDSA

func (d *DID) LoadECDSA(privateKeyHex string) error

func (*DID) Sign

func (d *DID) Sign(b []byte) ([]byte, error)

func (*DID) UnlockWallet

func (d *DID) UnlockWallet(keyFilePath, password string) error

UnlockWallet used to unlock wallet

type EncryptedKeyJSONV3

type EncryptedKeyJSONV3 struct {
	Address string              `json:"address"`
	Crypto  keystore.CryptoJSON `json:"crypto"`
	ID      string              `json:"id"`
	Version int                 `json:"version"`
}

EncryptedKeyJSONV3 is from geth

Jump to

Keyboard shortcuts

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