Documentation ¶
Overview ¶
nolint
Package auth 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).
You can create them with NewSig() and NewMultiSig(), and they fulfill the keys.Signable interface. You can then .Wrap() them to create a sdk.Tx.
Index ¶
- Constants
- func ErrInvalidSignature() errors.TMError
- func ErrTooManySignatures() errors.TMError
- func IsInvalidSignatureErr(err error) bool
- func IsTooManySignaturesErr(err error) bool
- func SigPerm(addr []byte) sdk.Actor
- func Sign(tx keys.Signable, key crypto.PrivKey) error
- type MultiSig
- func (s *MultiSig) Next() sdk.Tx
- func (s *MultiSig) Sign(pubkey crypto.PubKey, sig crypto.Signature) error
- func (s *MultiSig) SignBytes() []byte
- func (s *MultiSig) Signers() ([]crypto.PubKey, error)
- func (s *MultiSig) TxBytes() ([]byte, error)
- func (s *MultiSig) ValidateBasic() error
- func (s *MultiSig) Wrap() sdk.Tx
- type OneSig
- func (s *OneSig) Next() sdk.Tx
- func (s *OneSig) Sign(pubkey crypto.PubKey, sig crypto.Signature) error
- func (s *OneSig) SignBytes() []byte
- func (s *OneSig) Signers() ([]crypto.PubKey, error)
- func (s *OneSig) TxBytes() ([]byte, error)
- func (s *OneSig) ValidateBasic() error
- func (s *OneSig) Wrap() sdk.Tx
- type Signable
- type Signatures
- type Signed
Constants ¶
const ( // for signatures ByteSingleTx = 0x16 ByteMultiSig = 0x17 )
nolint
const ( // for signatures TypeSingleTx = NameSigs + "/one" TypeMultiSig = NameSigs + "/multi" )
nolint
const (
NameSigs = "sigs"
)
nolint
Variables ¶
This section is empty.
Functions ¶
func ErrInvalidSignature ¶
func ErrTooManySignatures ¶
func IsInvalidSignatureErr ¶
func IsTooManySignaturesErr ¶
Types ¶
type MultiSig ¶
MultiSig lets us wrap arbitrary data with a go-crypto signature
func (*MultiSig) Sign ¶
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 (*MultiSig) Signers ¶
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
func (*MultiSig) ValidateBasic ¶
type OneSig ¶
OneSig lets us wrap arbitrary data with a go-crypto signature
func (*OneSig) Sign ¶
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 (*OneSig) Signers ¶
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
func (*OneSig) ValidateBasic ¶
type Signatures ¶
type Signatures struct { stack.PassInitState stack.PassInitValidate }
Signatures parses out go-crypto signatures and adds permissions to the context for use inside the application
func (Signatures) CheckTx ¶
func (Signatures) CheckTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx, next sdk.Checker) (res sdk.CheckResult, err error)
CheckTx verifies the signatures are correct - fulfills Middlware interface
func (Signatures) DeliverTx ¶
func (Signatures) DeliverTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx, next sdk.Deliver) (res sdk.DeliverResult, err error)
DeliverTx verifies the signatures are correct - fulfills Middlware interface
func (Signatures) Name ¶
func (Signatures) Name() string
Name of the module - fulfills Middleware interface