Documentation ¶
Overview ¶
authutils package provides functions for all authentication and singature validation related operations
Index ¶
- Constants
- func CompareWithLatestBlockNumber(blockNumberPassed *big.Int) error
- func CurrentBlock() (*big.Int, error)
- func GetSignature(message []byte, privateKey *ecdsa.PrivateKey) (signature []byte)
- func GetSignerAddressFromMessage(message, signature []byte) (signer *common.Address, err error)
- func VerifyAddress(address common.Address, otherAddress common.Address) error
- func VerifySigner(message []byte, signature []byte, signer common.Address) error
Constants ¶
View Source
const (
AllowedBlockChainDifference = 5
)
Variables ¶
This section is empty.
Functions ¶
func CompareWithLatestBlockNumber ¶
Check if the block number passed is not more +- 5 from the latest block number on chain
func CurrentBlock ¶
Get the current block number from on chain
func GetSignature ¶
func GetSignature(message []byte, privateKey *ecdsa.PrivateKey) (signature []byte)
func VerifyAddress ¶
Check if the payment address/signer passed matches to what is present in the metadata
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.