key

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BcryptSecurityParameter = 12
View Source
var DefaultEncryptPassphrase = "xplaDefaultPassphrase"

Functions

func Bech32AddrString

func Bech32AddrString(p PrivateKey) (string, error)

Convert private key to bech32 address.

func EncryptArmorPrivKey

func EncryptArmorPrivKey(privKey cryptotypes.PrivKey, passphrase string) string

Encrypt secp-256k1 private key to make armored key.

func EncryptArmorPrivKeyWithoutPassphrase

func EncryptArmorPrivKeyWithoutPassphrase(privKey cryptotypes.PrivKey) string

Encrypt secp-256k1 private key to make armored key without passphrase for keyring. (for test)

func HexAddrString

func HexAddrString(p PrivateKey) string

Convert private key to hex address.

func NewMnemonic

func NewMnemonic() (string, error)

Make new mnemonic words by using bip39 entropy. Mnemonic words are changed every time user run new mnemonic function.

func NewPrivKey

func NewPrivKey(mnemonic string) (cryptotypes.PrivKey, error)

Make new private key. The private key generation algorithm uses eth-secp256k1 to use the evm module.

func UnarmorDecryptPrivKey

func UnarmorDecryptPrivKey(armorStr string, passphrase string) (privKey cryptotypes.PrivKey, algo string, err error)

Decrypt armored private key.

func UnarmorDecryptPrivKeyWithoutPassphrase

func UnarmorDecryptPrivKeyWithoutPassphrase(armorStr string) (privKey cryptotypes.PrivKey, algo string, err error)

Decrypt armored private key without passpharse for keyring. (for test)

Types

type PrivateKey

type PrivateKey = cryptotypes.PrivKey

type PublicKey added in v0.1.3

type PublicKey = cryptotypes.PubKey

Jump to

Keyboard shortcuts

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