identity

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeMsgCreateIdentity = "create_identity" // type for MsgCreateIdentity
	TypeMsgUpdateIdentity = "update_identity" // type for MsgUpdateIdentity

	IDLength     = 16  // size of the ID in bytes
	MaxURILength = 140 // maximum size of the URI

	// ModuleName is the name of the identity module
	ModuleName = "identity"
)

Identity message types and params

Variables

View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var PubKeyAlgorithm_name = map[int32]string{
	0: "UnknownPubKeyAlgorithm",
	1: "RSA",
	2: "DSA",
	3: "ECDSA",
	4: "ED25519",
	5: "SM2",
}
View Source
var PubKeyAlgorithm_value = map[string]int32{
	"UnknownPubKeyAlgorithm": 0,
	"RSA":                    1,
	"DSA":                    2,
	"ECDSA":                  3,
	"ED25519":                4,
	"SM2":                    5,
}

Functions

func ValidateIdentityFields

func ValidateIdentityFields(
	id tmbytes.HexBytes,
	pubKey *PubKeyInfo,
	certificate,
	credentials string,
	owner sdk.AccAddress,
) error

ValidateIdentityFields validates the given identity fields

Types

type CreateIdentityRequest

type CreateIdentityRequest struct {
	ID          string      `json:"id"`
	PubkeyInfo  *PubkeyInfo `json:"pubkey_info"`
	Certificate string      `json:"certificate"`
	Credentials *string     `json:"credentials"`
}

type Identity

type Identity struct {
	ID           github_com_bianjieai_irita_sdk_go_types.HexBytes   `protobuf:"bytes,1,opt,name=id,proto3,casttype=github.com/bianjieai/irita-sdk-go/types.HexBytes" json:"id,omitempty"`
	PubKeys      []PubKeyInfo                                       `protobuf:"bytes,2,rep,name=pub_keys,json=pubKeys,proto3" json:"pubkeys" yaml:"pubkeys"`
	Certificates []string                                           `protobuf:"bytes,3,rep,name=certificates,proto3" json:"certificates,omitempty"`
	Credentials  string                                             `protobuf:"bytes,4,opt,name=credentials,proto3" json:"credentials,omitempty"`
	Owner        github_com_bianjieai_irita_sdk_go_types.AccAddress `protobuf:"bytes,5,opt,name=owner,proto3,casttype=github.com/bianjieai/irita-sdk-go/types.AccAddress" json:"owner,omitempty"`
}

Identity defines a struct for an identity

func (Identity) Convert

func (m Identity) Convert() interface{}

func (*Identity) Descriptor

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

func (*Identity) Equal

func (this *Identity) Equal(that interface{}) bool

func (*Identity) Marshal

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

func (*Identity) MarshalTo

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

func (*Identity) MarshalToSizedBuffer

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

func (*Identity) ProtoMessage

func (*Identity) ProtoMessage()

func (*Identity) Reset

func (m *Identity) Reset()

func (*Identity) Size

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

func (*Identity) String

func (m *Identity) String() string

func (*Identity) Unmarshal

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

func (*Identity) XXX_DiscardUnknown

func (m *Identity) XXX_DiscardUnknown()

func (*Identity) XXX_Marshal

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

func (*Identity) XXX_Merge

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

func (*Identity) XXX_Size

func (m *Identity) XXX_Size() int

func (*Identity) XXX_Unmarshal

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

type IdentityI

type IdentityI interface {
	sdk.Module
	CreateIdentity(request CreateIdentityRequest, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)
	UpdateIdentity(request UpdateIdentityRequest, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)
	QueryIdentity(id string) (QueryIdentityResponse, sdk.Error)
}

func NewClient

func NewClient(bc sdk.BaseClient, cdc codec.Marshaler) IdentityI

type MsgCreateIdentity

type MsgCreateIdentity struct {
	ID          github_com_bianjieai_irita_sdk_go_types.HexBytes   `protobuf:"bytes,1,opt,name=id,proto3,casttype=github.com/bianjieai/irita-sdk-go/types.HexBytes" json:"id,omitempty"`
	PubKey      *PubKeyInfo                                        `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pubkey" yaml:"pubkey"`
	Certificate string                                             `protobuf:"bytes,3,opt,name=certificate,proto3" json:"certificate,omitempty"`
	Credentials string                                             `protobuf:"bytes,4,opt,name=credentials,proto3" json:"credentials,omitempty"`
	Owner       github_com_bianjieai_irita_sdk_go_types.AccAddress `protobuf:"bytes,5,opt,name=owner,proto3,casttype=github.com/bianjieai/irita-sdk-go/types.AccAddress" json:"owner,omitempty"`
}

MsgCreateIdentity defines a message to create an identity

func (*MsgCreateIdentity) Descriptor

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

func (*MsgCreateIdentity) Equal

func (this *MsgCreateIdentity) Equal(that interface{}) bool

func (MsgCreateIdentity) GetSignBytes

func (msg MsgCreateIdentity) GetSignBytes() []byte

GetSignBytes implements Msg

func (MsgCreateIdentity) GetSigners

func (msg MsgCreateIdentity) GetSigners() []sdk.AccAddress

GetSigners implements Msg

func (*MsgCreateIdentity) Marshal

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

func (*MsgCreateIdentity) MarshalTo

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

func (*MsgCreateIdentity) MarshalToSizedBuffer

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

func (*MsgCreateIdentity) ProtoMessage

func (*MsgCreateIdentity) ProtoMessage()

func (*MsgCreateIdentity) Reset

func (m *MsgCreateIdentity) Reset()

func (MsgCreateIdentity) Route

func (msg MsgCreateIdentity) Route() string

Route implements Msg

func (*MsgCreateIdentity) Size

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

func (*MsgCreateIdentity) String

func (m *MsgCreateIdentity) String() string

func (MsgCreateIdentity) Type

func (msg MsgCreateIdentity) Type() string

Type implements Msg

func (*MsgCreateIdentity) Unmarshal

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

func (MsgCreateIdentity) ValidateBasic

func (msg MsgCreateIdentity) ValidateBasic() error

ValidateBasic implements Msg

func (*MsgCreateIdentity) XXX_DiscardUnknown

func (m *MsgCreateIdentity) XXX_DiscardUnknown()

func (*MsgCreateIdentity) XXX_Marshal

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

func (*MsgCreateIdentity) XXX_Merge

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

func (*MsgCreateIdentity) XXX_Size

func (m *MsgCreateIdentity) XXX_Size() int

func (*MsgCreateIdentity) XXX_Unmarshal

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

type MsgUpdateIdentity

type MsgUpdateIdentity struct {
	ID          github_com_bianjieai_irita_sdk_go_types.HexBytes   `protobuf:"bytes,1,opt,name=id,proto3,casttype=github.com/bianjieai/irita-sdk-go/types.HexBytes" json:"id,omitempty"`
	PubKey      *PubKeyInfo                                        `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pubkey" yaml:"pubkey"`
	Certificate string                                             `protobuf:"bytes,3,opt,name=certificate,proto3" json:"certificate,omitempty"`
	Credentials string                                             `protobuf:"bytes,4,opt,name=credentials,proto3" json:"credentials,omitempty"`
	Owner       github_com_bianjieai_irita_sdk_go_types.AccAddress `protobuf:"bytes,5,opt,name=owner,proto3,casttype=github.com/bianjieai/irita-sdk-go/types.AccAddress" json:"owner,omitempty"`
}

MsgUpdateIdentity defines a message to update an identity

func (*MsgUpdateIdentity) Descriptor

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

func (*MsgUpdateIdentity) Equal

func (this *MsgUpdateIdentity) Equal(that interface{}) bool

func (MsgUpdateIdentity) GetSignBytes

func (msg MsgUpdateIdentity) GetSignBytes() []byte

GetSignBytes implements Msg.

func (MsgUpdateIdentity) GetSigners

func (msg MsgUpdateIdentity) GetSigners() []sdk.AccAddress

GetSigners implements Msg.

func (*MsgUpdateIdentity) Marshal

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

func (*MsgUpdateIdentity) MarshalTo

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

func (*MsgUpdateIdentity) MarshalToSizedBuffer

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

func (*MsgUpdateIdentity) ProtoMessage

func (*MsgUpdateIdentity) ProtoMessage()

func (*MsgUpdateIdentity) Reset

func (m *MsgUpdateIdentity) Reset()

func (MsgUpdateIdentity) Route

func (msg MsgUpdateIdentity) Route() string

Route implements Msg.

func (*MsgUpdateIdentity) Size

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

func (*MsgUpdateIdentity) String

func (m *MsgUpdateIdentity) String() string

func (MsgUpdateIdentity) Type

func (msg MsgUpdateIdentity) Type() string

Type implements Msg.

func (*MsgUpdateIdentity) Unmarshal

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

func (MsgUpdateIdentity) ValidateBasic

func (msg MsgUpdateIdentity) ValidateBasic() error

ValidateBasic implements Msg.

func (*MsgUpdateIdentity) XXX_DiscardUnknown

func (m *MsgUpdateIdentity) XXX_DiscardUnknown()

func (*MsgUpdateIdentity) XXX_Marshal

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

func (*MsgUpdateIdentity) XXX_Merge

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

func (*MsgUpdateIdentity) XXX_Size

func (m *MsgUpdateIdentity) XXX_Size() int

func (*MsgUpdateIdentity) XXX_Unmarshal

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

type PubKeyAlgorithm

type PubKeyAlgorithm int32

PubKeyAlgorithm defines the algorithm names for the public key

const (
	// UnknownPubKeyAlgorithm defines an unknown algorithm name
	UnknownPubKeyAlgorithm PubKeyAlgorithm = 0
	// RSA defines a RSA algorithm name
	RSA PubKeyAlgorithm = 1
	// DSA defines a DSA algorithm name.
	DSA PubKeyAlgorithm = 2
	// ECDSA defines an ECDSA algorithm name.
	ECDSA PubKeyAlgorithm = 3
	// ED25519 defines an ED25519 algorithm name.
	ED25519 PubKeyAlgorithm = 4
	// SM2 defines an SM2 algorithm name.
	SM2 PubKeyAlgorithm = 5
)

func (PubKeyAlgorithm) EnumDescriptor

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

func (PubKeyAlgorithm) MarshalJSON

func (p PubKeyAlgorithm) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation

func (*PubKeyAlgorithm) UnmarshalJSON

func (p *PubKeyAlgorithm) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals raw JSON bytes into a PubKeyAlgorithm

type PubKeyInfo

type PubKeyInfo struct {
	PubKey    github_com_bianjieai_irita_sdk_go_types.HexBytes `` /* 140-byte string literal not displayed */
	Algorithm PubKeyAlgorithm                                  `protobuf:"varint,2,opt,name=algorithm,proto3,enum=irita.modules.identity.PubKeyAlgorithm" json:"algorithm,omitempty"`
}

PubKey represents a public key along with the corresponding algorithm

func (*PubKeyInfo) Descriptor

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

func (*PubKeyInfo) Equal

func (this *PubKeyInfo) Equal(that interface{}) bool

func (*PubKeyInfo) Marshal

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

func (*PubKeyInfo) MarshalTo

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

func (*PubKeyInfo) MarshalToSizedBuffer

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

func (*PubKeyInfo) ProtoMessage

func (*PubKeyInfo) ProtoMessage()

func (*PubKeyInfo) Reset

func (m *PubKeyInfo) Reset()

func (*PubKeyInfo) Size

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

func (*PubKeyInfo) String

func (m *PubKeyInfo) String() string

func (*PubKeyInfo) Unmarshal

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

func (*PubKeyInfo) XXX_DiscardUnknown

func (m *PubKeyInfo) XXX_DiscardUnknown()

func (*PubKeyInfo) XXX_Marshal

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

func (*PubKeyInfo) XXX_Merge

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

func (*PubKeyInfo) XXX_Size

func (m *PubKeyInfo) XXX_Size() int

func (*PubKeyInfo) XXX_Unmarshal

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

type PubkeyInfo

type PubkeyInfo struct {
	PubKey     string          `json:"pub_key"`
	PubKeyAlgo PubKeyAlgorithm `json:"pub_key_algo"`
}

type QueryIdentityResponse

type QueryIdentityResponse struct {
	ID           string       `json:"id"`
	PubkeyInfos  []PubkeyInfo `json:"pubkey_infos"`
	Certificates []string     `json:"certificates"`
	Credentials  string       `json:"credentials"`
	Owner        string       `json:"owner"`
}

type UpdateIdentityRequest

type UpdateIdentityRequest struct {
	ID          string      `json:"id"`
	PubkeyInfo  *PubkeyInfo `json:"pubkey_info"`
	Certificate string      `json:"certificate"`
	Credentials *string     `json:"credentials"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL