Documentation ¶
Index ¶
- func CheckAccount(signedMsg types.SignedMessage, chainId types.ChainId, ...) (bool, error)
- func CheckSignature(signedMsg types.SignedMessage) (bool, error)
- func Ed25519Sign(privateKey ed25519.PrivateKey, data []byte) []byte
- func SignMessage(privateKey Ed25519PrivateKey, message string) (string, error)
- type Ed25519PrivateKey
- type Ed25519PublicKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAccount ¶
func CheckAccount(signedMsg types.SignedMessage, chainId types.ChainId, accountResource *types.AccountResource) (bool, error)
CheckAccount check account of signed message
func CheckSignature ¶
func CheckSignature(signedMsg types.SignedMessage) (bool, error)
func Ed25519Sign ¶
func Ed25519Sign(privateKey ed25519.PrivateKey, data []byte) []byte
func SignMessage ¶
func SignMessage(privateKey Ed25519PrivateKey, message string) (string, error)
Types ¶
type Ed25519PrivateKey ¶
type Ed25519PrivateKey struct {
// contains filtered or unexported fields
}
Ed25519PrivateKey implements `PrivateKey` interface for ed25519 private key
func NewEd25519PrivateKey ¶
func NewEd25519PrivateKey(key ed25519.PrivateKey) *Ed25519PrivateKey
NewEd25519PrivateKey creates `Ed25519PrivateKey`
func NewEd25519PrivateKeyFromString ¶
func NewEd25519PrivateKeyFromString(key string) (*Ed25519PrivateKey, error)
NewEd25519PrivateKeyFromString creates `*Ed25519PrivateKey` from given hex-encoded `ed25519.PrivateKey` string
func (*Ed25519PrivateKey) Hex ¶
func (k *Ed25519PrivateKey) Hex() string
Hex returns hex string of private key, used for testing
func (*Ed25519PrivateKey) Sign ¶
func (k *Ed25519PrivateKey) Sign(msg []byte) []byte
Sign signs given message bytes by private key
type Ed25519PublicKey ¶
type Ed25519PublicKey struct {
// contains filtered or unexported fields
}
Ed25519PublicKey implements `PublicKey` interface for ed25519 public key
func NewEd25519PublicKey ¶
func NewEd25519PublicKey(key ed25519.PublicKey) *Ed25519PublicKey
NewEd25519PublicKey creates `Ed25519PublicKey`
func NewEd25519PublicKeyFromString ¶
func NewEd25519PublicKeyFromString(key string) (*Ed25519PublicKey, error)
NewEd25519PublicKeyFromString creates `*Ed25519PublicKey` from given hex-encoded `ed25519.PublicKey` string
func (*Ed25519PublicKey) Bytes ¶
func (k *Ed25519PublicKey) Bytes() []byte
Bytes returns public key bytes
func (*Ed25519PublicKey) Hex ¶
func (k *Ed25519PublicKey) Hex() string
Hex returns hex string of the public key