Documentation ¶
Index ¶
- 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) (*pb.ECDSAAccountFromCloud, error)
- func GetAccountFromServer(bduss string) (*pb.ECDSAAccountFromCloud, 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 GetEcdsaPublicKeyFromJSON(jsonContent []byte) (*ecdsa.PublicKey, error)
- func GetOriginalAccountFromServer(bduss string) (*account.ECDSAAccount, error)
- func GetPublicKeyByPrivateKey(binaryPrivateKey string) (string, error)
- func SaveAccountFile(path string, address string, encryptPrivateKey []byte) error
- func SaveAccountToServer(accountInfo *account.ECDSAAccountToCloud, bduss string) error
- type AccountInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAndSaveSecretKey ¶
func CreateAndSaveSecretKey(path string, language int, strength uint8, password string, cryptography uint8) (*account.ECDSAInfo, error)
CreateAndSaveSecretKey 生成并保存私钥
func CreateAndSaveSecretKeyWithMnemonic ¶
func CreateAndSaveSecretKeyWithMnemonic(path string, language int, mnemonic string, password string) (*account.ECDSAInfo, error)
CreateAndSaveSecretKeyWithMnemonic 通过助记词来恢复并保存私钥 这里不应该再需要知道指定曲线了,也不需要知道版本号了,这个功能应该由助记词中的标记位来判断
func DecryptByKey ¶
DecryptByKey 解密
func EciesDecryptByJSONPrivateKey ¶
EciesDecryptByJSONPrivateKey 使用字符串私钥进行ecies解密
func EciesEncryptByJSONPublicKey ¶
EciesEncryptByJSONPublicKey 使用字符串公钥进行ecies加密
func EncryptAccount ¶
func EncryptAccount(info *account.ECDSAAccount, password string) (*account.ECDSAAccountToCloud, error)
EncryptAccount 使用支付密码加密账户信息
func GetAccountFromLocal ¶
func GetAccountFromLocal(path string) (*pb.ECDSAAccountFromCloud, error)
GetAccountFromLocal 读取本地文件获取账户信息, read account info from local file
func GetAccountFromServer ¶
func GetAccountFromServer(bduss string) (*pb.ECDSAAccountFromCloud, error)
GetAccountFromServer 获取云端有支付密码的账户
func GetBinaryEcdsaPrivateKeyFromFile ¶
GetBinaryEcdsaPrivateKeyFromFile parse binary ecdsa private key from file
func GetBinaryEcdsaPrivateKeyFromString ¶
GetBinaryEcdsaPrivateKeyFromString 通过二进制字符串获取真实私钥
func GetEcdsaPrivateKeyFromFile ¶
func GetEcdsaPrivateKeyFromFile(path string, password string) (*ecdsa.PrivateKey, error)
GetEcdsaPrivateKeyFromFile parse ecdsa private key from file
func GetEcdsaPublicKeyFromJSON ¶
GetEcdsaPublicKeyFromJSON parse ecdsa public key from json encoded string
func GetOriginalAccountFromServer ¶
func GetOriginalAccountFromServer(bduss string) (*account.ECDSAAccount, error)
GetOriginalAccountFromServer 获取云端没有支付密码的账户
func GetPublicKeyByPrivateKey ¶
GetPublicKeyByPrivateKey 通过私钥获取公钥
func SaveAccountFile ¶
SaveAccountFile 保存账户信息到文件,只需要保存address 和 privateKey
func SaveAccountToServer ¶
func SaveAccountToServer(accountInfo *account.ECDSAAccountToCloud, bduss string) error
SaveAccountToServer 将账户信息保存到云端