Documentation ¶
Index ¶
- Variables
- func CreateAndSaveSecretKey(path string, language int, strength uint8, password string, cryptography uint8) (*account.ECDSAInfo, error)
- func CreateAndSaveSecretKeyWithMnemonic(path string, language int, mnemonic string, password string) (*account.ECDSAInfo, error)
- func DecryptByKey(cipherInfo string, key string) (string, error)
- func EciesDecryptByJsonPrivateKey(privateKey string, cipherInfo string) (string, error)
- func EciesEncryptByJsonPublicKey(publicKey string, msg string) (string, error)
- func EncryptAccount(info *account.ECDSAAccount, password string) (*account.ECDSAAccountToCloud, error)
- func EncryptByKey(info string, key string) (string, error)
- func GetAccountFromLocal(path string) (*account.ECDSAAccountToCloud, error)
- func GetBinaryEcdsaPrivateKeyFromFile(path string, password string) ([]byte, error)
- func GetBinaryEcdsaPrivateKeyFromString(encryptPrivateKey string, password string) ([]byte, error)
- func GetEcdsaPrivateKeyFromFile(path string, password string) (*ecdsa.PrivateKey, error)
- func GetEcdsaPrivateKeyFromString(encryptPrivateKey string, password string) (*ecdsa.PrivateKey, error)
- func GetEcdsaPublicKeyFromJson(jsonContent []byte) (*ecdsa.PublicKey, error)
- func GetEncryptedPrivateKeyFromFile(path string) (string, error)
- func GetPublicKeyByPrivateKey(binaryPrivateKey string) (string, error)
- func SaveAccountFile(account *account.ECDSAAccountToCloud, path string) error
- type AccountInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 参数错误 ErrParam = errors.New("param is illegal") )
Functions ¶
func CreateAndSaveSecretKey ¶
func CreateAndSaveSecretKey(path string, language int, strength uint8, password string, cryptography uint8) (*account.ECDSAInfo, error)
生成并保存私钥
func CreateAndSaveSecretKeyWithMnemonic ¶
func CreateAndSaveSecretKeyWithMnemonic(path string, language int, mnemonic string, password string) (*account.ECDSAInfo, error)
通过助记词来恢复并保存私钥 这里不应该再需要知道指定曲线了,也不需要知道版本号了,这个功能应该由助记词中的标记位来判断
func DecryptByKey ¶
DecryptByKey 解密
func EciesDecryptByJsonPrivateKey ¶
EciesDecryptByJsonPublicKey 使用字符串私钥进行ecies解密
func EciesEncryptByJsonPublicKey ¶
EciesEncryptByJsonPublicKey 使用字符串公钥进行ecies加密
func EncryptAccount ¶
func EncryptAccount(info *account.ECDSAAccount, password string) (*account.ECDSAAccountToCloud, error)
使用支付密码加密账户信息
func GetAccountFromLocal ¶
func GetAccountFromLocal(path string) (*account.ECDSAAccountToCloud, error)
GetAccountFromLocal 读取本地文件获取账户信息
func GetBinaryEcdsaPrivateKeyFromString ¶
GetBinaryEcdsaPrivateKeyFromString通过二进制字符串获取真实私钥的字节数组
func GetEcdsaPrivateKeyFromFile ¶
func GetEcdsaPrivateKeyFromFile(path string, password string) (*ecdsa.PrivateKey, error)
func GetEcdsaPrivateKeyFromString ¶
func GetEcdsaPrivateKeyFromString(encryptPrivateKey string, password string) (*ecdsa.PrivateKey, error)
GetEcdsaPrivateKeyFromString通过二进制字符串获取真实私钥
func GetPublicKeyByPrivateKey ¶
GetPublicKeyByPrivateKey通过私钥获取公钥
func SaveAccountFile ¶
func SaveAccountFile(account *account.ECDSAAccountToCloud, path string) error
保存账户信息到文件,只需要保存address 和 privateKey
Types ¶
Click to show internal directories.
Click to hide internal directories.