cosmos-sdk: github.com/cosmos/cosmos-sdk/types/tx/signing Index | Files

package signing

import "github.com/cosmos/cosmos-sdk/types/tx/signing"

Index

Package Files

signature.go signature_data.go signing.pb.go

Variables

var (
    ErrInvalidLengthSigning        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowSigning          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupSigning = fmt.Errorf("proto: unexpected end of group")
)
var SignMode_name = map[int32]string{
    0:   "SIGN_MODE_UNSPECIFIED",
    1:   "SIGN_MODE_DIRECT",
    2:   "SIGN_MODE_TEXTUAL",
    127: "SIGN_MODE_LEGACY_AMINO_JSON",
}
var SignMode_value = map[string]int32{
    "SIGN_MODE_UNSPECIFIED":       0,
    "SIGN_MODE_DIRECT":            1,
    "SIGN_MODE_TEXTUAL":           2,
    "SIGN_MODE_LEGACY_AMINO_JSON": 127,
}

type MultiSignatureData Uses

type MultiSignatureData struct {
    // BitArray is a compact way of indicating which signers from the multisig key
    // have signed
    BitArray *types.CompactBitArray

    // Signatures is the nested SignatureData's for each signer
    Signatures []SignatureData
}

MultiSignatureData represents the nested SignatureData of a multisig signature

type SignMode Uses

type SignMode int32

SignMode represents a signing mode with its own security guarantees

const (
    // SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be rejected
    SignMode_SIGN_MODE_UNSPECIFIED SignMode = 0
    // SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is verified
    // with raw bytes from Tx
    SignMode_SIGN_MODE_DIRECT SignMode = 1
    // SIGN_MODE_TEXTUAL is a future signing mode that will verify some human-readable
    // textual representation on top of the binary representation from SIGN_MODE_DIRECT
    SignMode_SIGN_MODE_TEXTUAL SignMode = 2
    // SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
    // Amino JSON and will be removed in the future
    SignMode_SIGN_MODE_LEGACY_AMINO_JSON SignMode = 127
)

func (SignMode) EnumDescriptor Uses

func (SignMode) EnumDescriptor() ([]byte, []int)

func (SignMode) String Uses

func (x SignMode) String() string

type SignatureData Uses

type SignatureData interface {
    // contains filtered or unexported methods
}

SignatureData represents either a *SingleSignatureData or *MultiSignatureData. It is a convenience type that is easier to use in business logic than the encoded protobuf ModeInfo's and raw signatures.

func SignatureDataFromProto Uses

func SignatureDataFromProto(descData *SignatureDescriptor_Data) SignatureData

SignatureDataFromProto converts a SignatureDescriptor_Data to SignatureData. SignatureDescriptor_Data is considered an encoding type whereas SignatureData is used for business logic.

type SignatureDescriptor Uses

type SignatureDescriptor struct {
    // public_key is the public key of the signer
    PublicKey *types.PublicKey          `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
    Data      *SignatureDescriptor_Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}

SignatureDescriptor is a convenience type which represents the full data for a signature including the public key of the signer, signing modes and the signature itself. It is primarily used for coordinating signatures between clients.

func (*SignatureDescriptor) Descriptor Uses

func (*SignatureDescriptor) Descriptor() ([]byte, []int)

func (*SignatureDescriptor) GetData Uses

func (m *SignatureDescriptor) GetData() *SignatureDescriptor_Data

func (*SignatureDescriptor) GetPublicKey Uses

func (m *SignatureDescriptor) GetPublicKey() *types.PublicKey

func (*SignatureDescriptor) Marshal Uses

func (m *SignatureDescriptor) Marshal() (dAtA []byte, err error)

func (*SignatureDescriptor) MarshalTo Uses

func (m *SignatureDescriptor) MarshalTo(dAtA []byte) (int, error)

func (*SignatureDescriptor) MarshalToSizedBuffer Uses

func (m *SignatureDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SignatureDescriptor) ProtoMessage Uses

func (*SignatureDescriptor) ProtoMessage()

func (*SignatureDescriptor) Reset Uses

func (m *SignatureDescriptor) Reset()

func (*SignatureDescriptor) Size Uses

func (m *SignatureDescriptor) Size() (n int)

func (*SignatureDescriptor) String Uses

func (m *SignatureDescriptor) String() string

func (*SignatureDescriptor) Unmarshal Uses

func (m *SignatureDescriptor) Unmarshal(dAtA []byte) error

func (*SignatureDescriptor) XXX_DiscardUnknown Uses

func (m *SignatureDescriptor) XXX_DiscardUnknown()

func (*SignatureDescriptor) XXX_Marshal Uses

func (m *SignatureDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SignatureDescriptor) XXX_Merge Uses

func (m *SignatureDescriptor) XXX_Merge(src proto.Message)

func (*SignatureDescriptor) XXX_Size Uses

func (m *SignatureDescriptor) XXX_Size() int

func (*SignatureDescriptor) XXX_Unmarshal Uses

func (m *SignatureDescriptor) XXX_Unmarshal(b []byte) error

type SignatureDescriptor_Data Uses

type SignatureDescriptor_Data struct {
    // sum is the oneof that specifies whether this represents single or multi-signature data
    //
    // Types that are valid to be assigned to Sum:
    //	*SignatureDescriptor_Data_Single_
    //	*SignatureDescriptor_Data_Multi_
    Sum isSignatureDescriptor_Data_Sum `protobuf_oneof:"sum"`
}

Data represents signature data

func SignatureDataToProto Uses

func SignatureDataToProto(data SignatureData) *SignatureDescriptor_Data

SignatureDataToProto converts a SignatureData to SignatureDescriptor_Data. SignatureDescriptor_Data is considered an encoding type whereas SignatureData is used for business logic.

func (*SignatureDescriptor_Data) Descriptor Uses

func (*SignatureDescriptor_Data) Descriptor() ([]byte, []int)

func (*SignatureDescriptor_Data) GetMulti Uses

func (m *SignatureDescriptor_Data) GetMulti() *SignatureDescriptor_Data_Multi

func (*SignatureDescriptor_Data) GetSingle Uses

func (m *SignatureDescriptor_Data) GetSingle() *SignatureDescriptor_Data_Single

func (*SignatureDescriptor_Data) GetSum Uses

func (m *SignatureDescriptor_Data) GetSum() isSignatureDescriptor_Data_Sum

func (*SignatureDescriptor_Data) Marshal Uses

func (m *SignatureDescriptor_Data) Marshal() (dAtA []byte, err error)

func (*SignatureDescriptor_Data) MarshalTo Uses

func (m *SignatureDescriptor_Data) MarshalTo(dAtA []byte) (int, error)

func (*SignatureDescriptor_Data) MarshalToSizedBuffer Uses

func (m *SignatureDescriptor_Data) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SignatureDescriptor_Data) ProtoMessage Uses

func (*SignatureDescriptor_Data) ProtoMessage()

func (*SignatureDescriptor_Data) Reset Uses

func (m *SignatureDescriptor_Data) Reset()

func (*SignatureDescriptor_Data) Size Uses

func (m *SignatureDescriptor_Data) Size() (n int)

func (*SignatureDescriptor_Data) String Uses

func (m *SignatureDescriptor_Data) String() string

func (*SignatureDescriptor_Data) Unmarshal Uses

func (m *SignatureDescriptor_Data) Unmarshal(dAtA []byte) error

func (*SignatureDescriptor_Data) XXX_DiscardUnknown Uses

func (m *SignatureDescriptor_Data) XXX_DiscardUnknown()

func (*SignatureDescriptor_Data) XXX_Marshal Uses

func (m *SignatureDescriptor_Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SignatureDescriptor_Data) XXX_Merge Uses

func (m *SignatureDescriptor_Data) XXX_Merge(src proto.Message)

func (*SignatureDescriptor_Data) XXX_OneofWrappers Uses

func (*SignatureDescriptor_Data) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*SignatureDescriptor_Data) XXX_Size Uses

func (m *SignatureDescriptor_Data) XXX_Size() int

func (*SignatureDescriptor_Data) XXX_Unmarshal Uses

func (m *SignatureDescriptor_Data) XXX_Unmarshal(b []byte) error

type SignatureDescriptor_Data_Multi Uses

type SignatureDescriptor_Data_Multi struct {
    // bitarray specifies which keys within the multisig are signing
    Bitarray *types.CompactBitArray `protobuf:"bytes,1,opt,name=bitarray,proto3" json:"bitarray,omitempty"`
    // signatures is the signatures of the multi-signature
    Signatures []*SignatureDescriptor_Data `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"`
}

Multi is the signature data for a multisig public key

func (*SignatureDescriptor_Data_Multi) Descriptor Uses

func (*SignatureDescriptor_Data_Multi) Descriptor() ([]byte, []int)

func (*SignatureDescriptor_Data_Multi) GetBitarray Uses

func (m *SignatureDescriptor_Data_Multi) GetBitarray() *types.CompactBitArray

func (*SignatureDescriptor_Data_Multi) GetSignatures Uses

func (m *SignatureDescriptor_Data_Multi) GetSignatures() []*SignatureDescriptor_Data

func (*SignatureDescriptor_Data_Multi) Marshal Uses

func (m *SignatureDescriptor_Data_Multi) Marshal() (dAtA []byte, err error)

func (*SignatureDescriptor_Data_Multi) MarshalTo Uses

func (m *SignatureDescriptor_Data_Multi) MarshalTo(dAtA []byte) (int, error)

func (*SignatureDescriptor_Data_Multi) MarshalToSizedBuffer Uses

func (m *SignatureDescriptor_Data_Multi) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SignatureDescriptor_Data_Multi) ProtoMessage Uses

func (*SignatureDescriptor_Data_Multi) ProtoMessage()

func (*SignatureDescriptor_Data_Multi) Reset Uses

func (m *SignatureDescriptor_Data_Multi) Reset()

func (*SignatureDescriptor_Data_Multi) Size Uses

func (m *SignatureDescriptor_Data_Multi) Size() (n int)

func (*SignatureDescriptor_Data_Multi) String Uses

func (m *SignatureDescriptor_Data_Multi) String() string

func (*SignatureDescriptor_Data_Multi) Unmarshal Uses

func (m *SignatureDescriptor_Data_Multi) Unmarshal(dAtA []byte) error

func (*SignatureDescriptor_Data_Multi) XXX_DiscardUnknown Uses

func (m *SignatureDescriptor_Data_Multi) XXX_DiscardUnknown()

func (*SignatureDescriptor_Data_Multi) XXX_Marshal Uses

func (m *SignatureDescriptor_Data_Multi) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SignatureDescriptor_Data_Multi) XXX_Merge Uses

func (m *SignatureDescriptor_Data_Multi) XXX_Merge(src proto.Message)

func (*SignatureDescriptor_Data_Multi) XXX_Size Uses

func (m *SignatureDescriptor_Data_Multi) XXX_Size() int

func (*SignatureDescriptor_Data_Multi) XXX_Unmarshal Uses

func (m *SignatureDescriptor_Data_Multi) XXX_Unmarshal(b []byte) error

type SignatureDescriptor_Data_Multi_ Uses

type SignatureDescriptor_Data_Multi_ struct {
    Multi *SignatureDescriptor_Data_Multi `protobuf:"bytes,2,opt,name=multi,proto3,oneof" json:"multi,omitempty"`
}

func (*SignatureDescriptor_Data_Multi_) MarshalTo Uses

func (m *SignatureDescriptor_Data_Multi_) MarshalTo(dAtA []byte) (int, error)

func (*SignatureDescriptor_Data_Multi_) MarshalToSizedBuffer Uses

func (m *SignatureDescriptor_Data_Multi_) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SignatureDescriptor_Data_Multi_) Size Uses

func (m *SignatureDescriptor_Data_Multi_) Size() (n int)

type SignatureDescriptor_Data_Single Uses

type SignatureDescriptor_Data_Single struct {
    // mode is the signing mode of the single signer
    Mode SignMode `protobuf:"varint,1,opt,name=mode,proto3,enum=cosmos.tx.signing.SignMode" json:"mode,omitempty"`
    // signature is the raw signature bytes
    Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
}

Single is the signature data for a single signer

func (*SignatureDescriptor_Data_Single) Descriptor Uses

func (*SignatureDescriptor_Data_Single) Descriptor() ([]byte, []int)

func (*SignatureDescriptor_Data_Single) GetMode Uses

func (m *SignatureDescriptor_Data_Single) GetMode() SignMode

func (*SignatureDescriptor_Data_Single) GetSignature Uses

func (m *SignatureDescriptor_Data_Single) GetSignature() []byte

func (*SignatureDescriptor_Data_Single) Marshal Uses

func (m *SignatureDescriptor_Data_Single) Marshal() (dAtA []byte, err error)

func (*SignatureDescriptor_Data_Single) MarshalTo Uses

func (m *SignatureDescriptor_Data_Single) MarshalTo(dAtA []byte) (int, error)

func (*SignatureDescriptor_Data_Single) MarshalToSizedBuffer Uses

func (m *SignatureDescriptor_Data_Single) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SignatureDescriptor_Data_Single) ProtoMessage Uses

func (*SignatureDescriptor_Data_Single) ProtoMessage()

func (*SignatureDescriptor_Data_Single) Reset Uses

func (m *SignatureDescriptor_Data_Single) Reset()

func (*SignatureDescriptor_Data_Single) Size Uses

func (m *SignatureDescriptor_Data_Single) Size() (n int)

func (*SignatureDescriptor_Data_Single) String Uses

func (m *SignatureDescriptor_Data_Single) String() string

func (*SignatureDescriptor_Data_Single) Unmarshal Uses

func (m *SignatureDescriptor_Data_Single) Unmarshal(dAtA []byte) error

func (*SignatureDescriptor_Data_Single) XXX_DiscardUnknown Uses

func (m *SignatureDescriptor_Data_Single) XXX_DiscardUnknown()

func (*SignatureDescriptor_Data_Single) XXX_Marshal Uses

func (m *SignatureDescriptor_Data_Single) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SignatureDescriptor_Data_Single) XXX_Merge Uses

func (m *SignatureDescriptor_Data_Single) XXX_Merge(src proto.Message)

func (*SignatureDescriptor_Data_Single) XXX_Size Uses

func (m *SignatureDescriptor_Data_Single) XXX_Size() int

func (*SignatureDescriptor_Data_Single) XXX_Unmarshal Uses

func (m *SignatureDescriptor_Data_Single) XXX_Unmarshal(b []byte) error

type SignatureDescriptor_Data_Single_ Uses

type SignatureDescriptor_Data_Single_ struct {
    Single *SignatureDescriptor_Data_Single `protobuf:"bytes,1,opt,name=single,proto3,oneof" json:"single,omitempty"`
}

func (*SignatureDescriptor_Data_Single_) MarshalTo Uses

func (m *SignatureDescriptor_Data_Single_) MarshalTo(dAtA []byte) (int, error)

func (*SignatureDescriptor_Data_Single_) MarshalToSizedBuffer Uses

func (m *SignatureDescriptor_Data_Single_) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SignatureDescriptor_Data_Single_) Size Uses

func (m *SignatureDescriptor_Data_Single_) Size() (n int)

type SignatureDescriptors Uses

type SignatureDescriptors struct {
    // signatures are the signature descriptors
    Signatures []*SignatureDescriptor `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"`
}

SignatureDescriptors wraps multiple SignatureDescriptor's.

func (*SignatureDescriptors) Descriptor Uses

func (*SignatureDescriptors) Descriptor() ([]byte, []int)

func (*SignatureDescriptors) GetSignatures Uses

func (m *SignatureDescriptors) GetSignatures() []*SignatureDescriptor

func (*SignatureDescriptors) Marshal Uses

func (m *SignatureDescriptors) Marshal() (dAtA []byte, err error)

func (*SignatureDescriptors) MarshalTo Uses

func (m *SignatureDescriptors) MarshalTo(dAtA []byte) (int, error)

func (*SignatureDescriptors) MarshalToSizedBuffer Uses

func (m *SignatureDescriptors) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SignatureDescriptors) ProtoMessage Uses

func (*SignatureDescriptors) ProtoMessage()

func (*SignatureDescriptors) Reset Uses

func (m *SignatureDescriptors) Reset()

func (*SignatureDescriptors) Size Uses

func (m *SignatureDescriptors) Size() (n int)

func (*SignatureDescriptors) String Uses

func (m *SignatureDescriptors) String() string

func (*SignatureDescriptors) Unmarshal Uses

func (m *SignatureDescriptors) Unmarshal(dAtA []byte) error

func (*SignatureDescriptors) XXX_DiscardUnknown Uses

func (m *SignatureDescriptors) XXX_DiscardUnknown()

func (*SignatureDescriptors) XXX_Marshal Uses

func (m *SignatureDescriptors) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SignatureDescriptors) XXX_Merge Uses

func (m *SignatureDescriptors) XXX_Merge(src proto.Message)

func (*SignatureDescriptors) XXX_Size Uses

func (m *SignatureDescriptors) XXX_Size() int

func (*SignatureDescriptors) XXX_Unmarshal Uses

func (m *SignatureDescriptors) XXX_Unmarshal(b []byte) error

type SignatureV2 Uses

type SignatureV2 struct {
    // PubKey is the public key to use for verifying the signature
    PubKey crypto.PubKey

    // Data is the actual data of the signature which includes SignMode's and
    // the signatures themselves for either single or multi-signatures.
    Data SignatureData
}

SignatureV2 is a convenience type that is easier to use in application logic than the protobuf SignerInfo's and raw signature bytes. It goes beyond the first sdk.Signature types by supporting sign modes and explicitly nested multi-signatures. It is intended to be used for both building and verifying signatures.

type SingleSignatureData Uses

type SingleSignatureData struct {
    // SignMode represents the SignMode of the signature
    SignMode SignMode

    // SignMode represents the SignMode of the signature
    Signature []byte
}

SingleSignatureData represents the signature and SignMode of a single (non-multisig) signer

Package signing imports 7 packages (graph) and is imported by 12 packages. Updated 2020-08-01. Refresh now. Tools for package owners.