Documentation ¶
Index ¶
- Constants
- func GenerateSigningKeyPair() (publicKey, privateKey []byte)
- func GetAddress(publicKey []byte) string
- func GetEthAuthKeyFromConfig() (public, private []byte, err error)
- func GetIDConfig() (identityConfig *config.IdentityConfig, err error)
- func GetPrivateEthAuthKey(fileName string) (key []byte, err error)
- func GetPublicEthAuthKey(fileName string) (key []byte, err error)
- func Sign(message []byte, privateKey []byte) (signature []byte, err error)
- func SignEthereum(message []byte, privateKey []byte) (signature []byte, err error)
- func SignHash(data []byte) []byte
- func VerifySignature(publicKey, message, signature []byte) bool
- func VerifySignatureWithAddress(address, sigHex string, msg []byte) bool
Constants ¶
View Source
const PrivateKeyLen = 32
View Source
const SignatureRSFormatLen = 64 //64 byte [R || S] format
View Source
const SignatureRSVFormatLen = 65 //65 byte [R || S || V] format
View Source
const SignatureVPosition = 64
Variables ¶
This section is empty.
Functions ¶
func GenerateSigningKeyPair ¶
func GenerateSigningKeyPair() (publicKey, privateKey []byte)
func GetAddress ¶
func GetEthAuthKeyFromConfig ¶
GetEthAuthKeyFromConfig returns the public and private keys as byte array
func GetIDConfig ¶
func GetIDConfig() (identityConfig *config.IdentityConfig, err error)
GetIDConfig reads the keys and ID from the config and returns a the Identity config
func GetPrivateEthAuthKey ¶
GetPrivateEthAuthKey returns the private key from the file
func GetPublicEthAuthKey ¶
GetPublicEthAuthKey returns the public key from the file
func SignEthereum ¶
func VerifySignature ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.