Documentation
¶
Index ¶
- func BytesToPubKey(pk_bytes []byte) (*ecdsa.PublicKey, error)
- func CompressedPubkeyHex(pk *ecdsa.PublicKey) string
- func GenerateKeypair() (publicKey *ecdsa.PublicKey, privateKey *ecdsa.PrivateKey)
- func RecoverPubkeyFromPersonalSignature(payload string, signature []byte) (pubkey *ecdsa.PublicKey, err error)
- func SignPersonal(payload []byte, sk *ecdsa.PrivateKey) (signature []byte, err error)
- func StringToPubkey(pk_str string) (*ecdsa.PublicKey, error)
- func ValidatePersonalSignature(payload string, signature []byte, pubkey *ecdsa.PublicKey) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToPubKey ¶
BytesToPubKey is compatible with comressed / uncompressed pubkey bytes.
func CompressedPubkeyHex ¶
CompressedPubkeyHex has no "0x".
func GenerateKeypair ¶
func GenerateKeypair() (publicKey *ecdsa.PublicKey, privateKey *ecdsa.PrivateKey)
GenerateKeypair generates a keypair. For test purpose only.
func RecoverPubkeyFromPersonalSignature ¶
func RecoverPubkeyFromPersonalSignature(payload string, signature []byte) (pubkey *ecdsa.PublicKey, err error)
RecoverPubkeyFromPersonalSignature extract a public key from signature
func SignPersonal ¶
func SignPersonal(payload []byte, sk *ecdsa.PrivateKey) (signature []byte, err error)
SignPersonal signs a payload using given secret key. For test purpose only.
func StringToPubkey ¶
StringToPubkey is compatible with comressed / uncompressed pubkey hex, and with / without '0x' head.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.