Documentation ¶
Index ¶
- Constants
- Variables
- func VerifyMessage(req *VerifyMessageRequest) (bool, error)
- type SignatureAlgorithm
- func (a *SignatureAlgorithm) MarshalJSON() ([]byte, error)
- func (a *SignatureAlgorithm) Name() string
- func (a *SignatureAlgorithm) Sign(priv crypto.PrivateKey, buf []byte) ([]byte, error)
- func (a *SignatureAlgorithm) UnmarshalJSON(data []byte) error
- func (a *SignatureAlgorithm) Verify(pub crypto.PublicKey, message, sig []byte) (bool, error)
- func (a *SignatureAlgorithm) Version() uint32
- type VerifyMessageRequest
Constants ¶
View Source
const (
Ed25519 string = "vega/ed25519"
)
Variables ¶
View Source
var ( // ErrBadED25519PrivateKeyLength is returned if a private key with incorrect length is supplied. ErrBadED25519PrivateKeyLength = errors.New("bad ed25519 private key length") // ErrBadED25519PublicKeyLength is returned if a public key with incorrect length is supplied. ErrBadED25519PublicKeyLength = errors.New("bad ed25519 public key length") ErrCouldNotCastPrivateKeyToBytes = errors.New("couldn't cast private key to bytes") ErrCouldNotCastPublicKeyToBytes = errors.New("couldn't cast public key to bytes") ErrSignatureIsNil = errors.New("signature is nil") )
View Source
var ErrUnsupportedSignatureAlgorithm = errors.New("unsupported signature algorithm")
Functions ¶
func VerifyMessage ¶
func VerifyMessage(req *VerifyMessageRequest) (bool, error)
Types ¶
type SignatureAlgorithm ¶
type SignatureAlgorithm struct {
// contains filtered or unexported fields
}
func NewEd25519 ¶
func NewEd25519() SignatureAlgorithm
func NewSignatureAlgorithm ¶
func NewSignatureAlgorithm(name string, version uint32) (SignatureAlgorithm, error)
func (*SignatureAlgorithm) MarshalJSON ¶
func (a *SignatureAlgorithm) MarshalJSON() ([]byte, error)
func (*SignatureAlgorithm) Name ¶
func (a *SignatureAlgorithm) Name() string
func (*SignatureAlgorithm) Sign ¶
func (a *SignatureAlgorithm) Sign(priv crypto.PrivateKey, buf []byte) ([]byte, error)
func (*SignatureAlgorithm) UnmarshalJSON ¶
func (a *SignatureAlgorithm) UnmarshalJSON(data []byte) error
func (*SignatureAlgorithm) Version ¶
func (a *SignatureAlgorithm) Version() uint32
type VerifyMessageRequest ¶
Click to show internal directories.
Click to hide internal directories.