Documentation ¶
Index ¶
- func GenerateECDSAKeyPair(password []byte, salt []byte, iterations, keyLength int, useSHA512 bool) (*ecdsa.PrivateKey, []byte, error)
- func GetAddress(pubKey []byte) string
- func GetPubKeyHash(addr string) ([]byte, error)
- func GetPubKeyHashFromPrivKey(ownerPriv *ecdsa.PrivateKey) ([]byte, error)
- func HashPubKey(pubKey []byte) []byte
- func PubKeyHashGetAddress(pubKeyHash []byte) string
- func ValidateAddress(address string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateECDSAKeyPair ¶
func GenerateECDSAKeyPair(password []byte, salt []byte, iterations, keyLength int, useSHA512 bool) (*ecdsa.PrivateKey, []byte, error)
GenerateECDSAKeyPair 从一个给定的种子(seed)生成椭圆曲线(Elliptic Curve)的密钥对. 接受种子(seed)、哈希函数类型(useSHA512)、盐(salt)、迭代次数(iterations)和密钥长度(keyLength)作为参数。 使用 PBKDF2 算法和指定的哈希函数从种子生成密钥。 然后,使用这个密钥和椭圆曲线算法生成 ECDSA 密钥对。
func GetPubKeyHash ¶
GetPubKeyHash 从Base58编码的地址中提取公钥哈希。 参数 addressStr 是Base58编码的地址。 返回公钥哈希和可能发生的错误。
func GetPubKeyHashFromPrivKey ¶
func GetPubKeyHashFromPrivKey(ownerPriv *ecdsa.PrivateKey) ([]byte, error)
GetPubKeyHashFromPrivKey 从ECDSA私钥中提取公钥哈希。 参数 ownerPriv 是ECDSA私钥。 返回公钥哈希和可能发生的错误。
func HashPubKey ¶
hashPubKey 返回给定钥的 SHA-256 哈希值的 RIPEMD160 哈希值。 参数 pubKeyBytes 是公钥的字节表示。 返回公钥的哈希值。
func PubKeyHashGetAddress ¶
PubKeyHashGetAddress 返回公钥哈希对应的钱包地址
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.