Documentation
¶
Index ¶
- Constants
- func AddCachedPassphrase(addr, passphrase string) error
- func AesGcmDecrypt(key, ciphertext, nonce []byte) (plaintext string)
- func AesGcmEncrypt(key []byte, plaintext string) (ciphertext, nonce []byte)
- func ChangePassphrase(addr, oldPassphrase, newPassphrase string) error
- func CheckValid(str string) (string, bool)
- func CloseKeybase()
- func DeleteAccount(addr, passphrase string) error
- func GenerateMnemonic(prefix, suffix string, repFn func(uint64, float64), numCpu int) (string, string)
- func GetCachedPassphrase(addr string) (res string, ok bool)
- func GetMnemonic(addr, passphrase string) (string, error)
- func HasAccount(addr string) bool
- func KeybaseOpened() bool
- func OpenKeybase(fname string) error
- func Sign(name, passphrase string, msg []byte) (string, error)
- type AccountInfo
- type MyKeyBase
- func (kb *MyKeyBase) AddAccount(accInfo AccountInfo)
- func (kb *MyKeyBase) AddCachedPassphrase(addr, passphrase string) error
- func (kb *MyKeyBase) ChangePassphrase(addr, oldPassphrase, newPassphrase string) error
- func (kb *MyKeyBase) Close()
- func (kb *MyKeyBase) DeleteAccount(addr string)
- func (kb *MyKeyBase) GetAccountInfo(addr string) (AccountInfo, bool)
- func (kb *MyKeyBase) GetCachedPassphrase(addr string) (res string, ok bool)
- func (kb *MyKeyBase) GetMnemonic(addr, passphrase string) (string, error)
- func (kb *MyKeyBase) GetStringItems() (items []string)
- func (kb *MyKeyBase) Init(openedFile *os.File, accounts []AccountInfo)
- func (kb *MyKeyBase) IsOpen() bool
- func (kb *MyKeyBase) Save() error
- func (kb *MyKeyBase) Sign(addr, passphrase string, msg []byte) (sig []byte, pubk secp256k1.PubKeySecp256k1, err error)
Constants ¶
View Source
const ( DefaultCoinType = 688 DefaultBIP39Passphrase = "" )
View Source
const AddrPrefix = "coinex1"
View Source
const (
AesNonceLength = 12
)
View Source
const BatchCount = 200
View Source
const BigBatchCount = 10 * BatchCount
Variables ¶
This section is empty.
Functions ¶
func AddCachedPassphrase ¶
func AesGcmDecrypt ¶
AesGcmDecrypt takes an decryption key, a ciphertext and the corresponding nonce, and decrypts it with AES256 in GCM mode. Returns the plaintext string. len(key) must be 32, to select AES256
func AesGcmEncrypt ¶
================================================ AesGcmEncrypt takes an encryption key and a plaintext string and encrypts it with AES256 in GCM mode, which provides authenticated encryption. Returns the ciphertext and the used nonce. len(key) must be 32, to select AES256
func ChangePassphrase ¶
func CheckValid ¶
func CloseKeybase ¶
func CloseKeybase()
func DeleteAccount ¶
func GenerateMnemonic ¶
func GetCachedPassphrase ¶
func GetMnemonic ¶
func HasAccount ¶
func KeybaseOpened ¶
func KeybaseOpened() bool
func OpenKeybase ¶
Types ¶
type AccountInfo ¶
type AccountInfo struct { Memo string `json:"memo"` Address string `json:"address"` PassphraseCksum []byte `json:"passphrase_cksum"` EncryptedMnemonic []byte `json:"encrypted_mnemonic"` }
func CreateAccount ¶
func CreateAccount(memo, mnemonic, passphrase string) (AccountInfo, error)
func NewAccountInfo ¶
func NewAccountInfo(memo, mnemonic, passphrase string) AccountInfo
func (AccountInfo) CheckPassphrase ¶
func (acc AccountInfo) CheckPassphrase(passphrase string) error
type MyKeyBase ¶
type MyKeyBase struct { Accounts []AccountInfo // contains filtered or unexported fields }
var KB MyKeyBase
================================================
func (*MyKeyBase) AddAccount ¶
func (kb *MyKeyBase) AddAccount(accInfo AccountInfo)
func (*MyKeyBase) AddCachedPassphrase ¶
func (*MyKeyBase) ChangePassphrase ¶
func (*MyKeyBase) DeleteAccount ¶
func (*MyKeyBase) GetAccountInfo ¶
func (kb *MyKeyBase) GetAccountInfo(addr string) (AccountInfo, bool)
func (*MyKeyBase) GetCachedPassphrase ¶
func (*MyKeyBase) GetMnemonic ¶
func (*MyKeyBase) GetStringItems ¶
Click to show internal directories.
Click to hide internal directories.