Documentation
¶
Index ¶
- Variables
- func GenerateNonce() string
- type ExpiredMessage
- type InvalidMessage
- type InvalidSignature
- type Message
- func (m *Message) GetAddress() common.Address
- func (m *Message) GetChainID() int
- func (m *Message) GetDomain() string
- func (m *Message) GetExpirationTime() *string
- func (m *Message) GetIssuedAt() string
- func (m *Message) GetNonce() string
- func (m *Message) GetNotBefore() *string
- func (m *Message) GetRequestID() *string
- func (m *Message) GetResources() []url.URL
- func (m *Message) GetStatement() *string
- func (m *Message) GetURI() url.URL
- func (m *Message) GetVersion() string
- func (m *Message) String() string
- func (m *Message) ValidAt(when time.Time) (bool, error)
- func (m *Message) ValidNow() (bool, error)
- func (m *Message) Verify(signature string, domain *string, nonce *string, timestamp *time.Time, ...) (*ecdsa.PublicKey, error)
- func (m *Message) VerifyEIP191(signature string) (*ecdsa.PublicKey, error)
- func (m *Message) VerifyERC1271(ctx context.Context, signature string, provider Provider) error
- type Provider
Constants ¶
This section is empty.
Variables ¶
View Source
var ERC1271MagicValue = [4]byte{0x16, 0x26, 0xba, 0x7e}
ERC1271MagicValue is the value that must be returned by a contract's isValidSignature function to indicate a valid signature according to EIP-1271
View Source
var IsValidSignatureSelector = [4]byte{0x16, 0x26, 0xba, 0x7e}
IsValidSignatureSelector is the function selector for the ERC-1271 isValidSignature function
Functions ¶
func GenerateNonce ¶
func GenerateNonce() string
Types ¶
type ExpiredMessage ¶
type ExpiredMessage struct {
// contains filtered or unexported fields
}
func (*ExpiredMessage) Error ¶
func (m *ExpiredMessage) Error() string
type InvalidMessage ¶
type InvalidMessage struct {
// contains filtered or unexported fields
}
func (*InvalidMessage) Error ¶
func (m *InvalidMessage) Error() string
type InvalidSignature ¶
type InvalidSignature struct {
// contains filtered or unexported fields
}
func (*InvalidSignature) Error ¶
func (m *InvalidSignature) Error() string
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func InitMessage ¶
func InitMessage(domain, address, uri, nonce string, options map[string]interface{}) (*Message, error)
InitMessage creates a Message object with the provided parameters
func ParseMessage ¶
ParseMessage returns a Message object by parsing an EIP-4361 formatted string
func (*Message) GetAddress ¶
func (*Message) GetChainID ¶
func (*Message) GetExpirationTime ¶
func (*Message) GetIssuedAt ¶
func (*Message) GetNotBefore ¶
func (*Message) GetRequestID ¶
func (*Message) GetResources ¶
func (*Message) GetStatement ¶
func (*Message) GetVersion ¶
func (*Message) ValidAt ¶
ValidAt validates the time constraints of the message at a specific point in time.
func (*Message) Verify ¶
func (m *Message) Verify(signature string, domain *string, nonce *string, timestamp *time.Time, provider Provider) (*ecdsa.PublicKey, error)
Verify validates time constraints and integrity of the object by matching it's signature.
func (*Message) VerifyEIP191 ¶
VerifyEIP191 validates the integrity of the object by matching it's signature.
Click to show internal directories.
Click to hide internal directories.