Documentation ¶
Index ¶
- Constants
- func GetEcdsaPublicKeyByPrivateKey(prikey *ecdsa.PrivateKey) (publicKeyECDSA *ecdsa.PublicKey, err error)
- func GetEthAddressByBytePublicKey(publicKey []byte) (address string, err error)
- func GetEthMessageHash(message string) (msgHash []byte)
- func GetKeccak256Hash(msg []byte) (msgHash []byte)
- func GetPrivateKeyWithEcdsa(privateKey string) (prikey *ecdsa.PrivateKey, err error)
- func GetPublicKeyBySign(msgHash, signature []byte) (sigPublicKey []byte, err error)
- func ValidateSignature(message, signature, address string) (valid bool)
- type Bytes
Constants ¶
View Source
const EthPrefix = "\x19Ethereum Signed Message:\n"
View Source
const PrivateKeyLen = 64
View Source
const PublicKeyLen = 65 // 04 + X + Y
View Source
const SignatureLen = 65 // R + S + V
Variables ¶
This section is empty.
Functions ¶
func GetEcdsaPublicKeyByPrivateKey ¶
func GetEcdsaPublicKeyByPrivateKey(prikey *ecdsa.PrivateKey) (publicKeyECDSA *ecdsa.PublicKey, err error)
func GetEthMessageHash ¶
func GetKeccak256Hash ¶
func GetPrivateKeyWithEcdsa ¶
func GetPrivateKeyWithEcdsa(privateKey string) (prikey *ecdsa.PrivateKey, err error)
func GetPublicKeyBySign ¶
func ValidateSignature ¶
Types ¶
type Bytes ¶
type Bytes []byte
func GetPublicKeyByPrivateKey ¶
func GetPublicKeyByPrivateKey(prikey *ecdsa.PrivateKey) (publicKey Bytes, err error)
func (Bytes) EncodeToString ¶
Click to show internal directories.
Click to hide internal directories.