import "github.com/tendermint/light-client/tx"
package tx contains generic Signable implementations that can be used by your application or tests to handle authentication needs.
It currently supports transaction data as opaque bytes and either single or multiple private key signatures using straightforward algorithms. It currently does not support N-of-M key share signing of other more complex algorithms (although it would be great to add them)
TODO: This package should be moved into go-keys/go-crypto
docs.go multi.go one.go reader.go
var TxMapper data.Mapper
type MultiSig struct {
// contains filtered or unexported fields
}
MultiSig lets us wrap arbitrary data with a go-crypto signature
TODO: rethink how we want to integrate this with KeyStore so it makes more sense (particularly the verify method)
func (s *MultiSig) Sign(pubkey crypto.PubKey, sig crypto.Signature) error
Sign will add a signature and pubkey.
Depending on the Signable, one may be able to call this multiple times for multisig Returns error if called with invalid data or too many times
func (s *MultiSig) SignBytes() []byte
SignBytes returns the original data passed into NewSig
func (s *MultiSig) Signers() ([]crypto.PubKey, error)
Signers will return the public key(s) that signed if the signature is valid, or an error if there is any issue with the signature, including if there are no signatures
type OneSig struct {
// contains filtered or unexported fields
}
OneSig lets us wrap arbitrary data with a go-crypto signature
TODO: rethink how we want to integrate this with KeyStore so it makes more sense (particularly the verify method)
func (s *OneSig) Sign(pubkey crypto.PubKey, sig crypto.Signature) error
Sign will add a signature and pubkey.
Depending on the Signable, one may be able to call this multiple times for multisig Returns error if called with invalid data or too many times
func (s *OneSig) SignBytes() []byte
SignBytes returns the original data passed into NewSig
func (s *OneSig) Signers() ([]crypto.PubKey, error)
Signers will return the public key(s) that signed if the signature is valid, or an error if there is any issue with the signature, including if there are no signatures
type Sig struct {
SigInner
}
Sig is what is exported, and handles serialization
func New(data []byte) Sig
func NewMulti(data []byte) Sig
func (s Sig) TxBytes() ([]byte, error)
type SigInner interface {
SignBytes() []byte
Sign(pubkey crypto.PubKey, sig crypto.Signature) error
Signers() ([]crypto.PubKey, error)
}
Generated by godoc2md