Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct { Version int `json:"version,required"` // version of the request Expiry time.Time `json:"expiry,required"` // avoid replay attacks Address string `json:"address,required"` // address of the sender, must match the signature Data []byte `json:"data,required"` // data to be sent to the server }
func (*Request) Encrypt ¶
Encrypt encrypts the request data using the public key, result is base64 encoded
func (*Request) GenerateSignature ¶
GenerateSignature generates a signature for the request using a private key
func (*Request) RecoverAddress ¶
RecoverAddress uses the provided signature and returns the corresponding address
func (*Request) VerifySignature ¶
VerifySignature verifies the provided signature using the public key against a marshalled version of the request
Click to show internal directories.
Click to hide internal directories.