Documentation ¶
Overview ¶
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func CheckCertificate(cert []byte) error
- func GetCertificateKey(identityID []byte, certHash []byte) []byte
- func GetCertificateSubspace(identityID []byte) []byte
- func GetCredentialsKey(identityID []byte) []byte
- func GetDataKey(identityID []byte) []byte
- func GetOwnerKey(identityID []byte) []byte
- func GetPubKeyIdentityKey(pubKey *PubKeyInfo) []byte
- func GetPubKeyInfoKey(identityID []byte, pubKey *PubKeyInfo) []byte
- func GetPubKeySubspace(identityID []byte) []byte
- func RegisterInterfaces(registry types.InterfaceRegistry)
- func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
- func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- func ValidateDSAPubKey(pubKey []byte) error
- func ValidateGenesis(data GenesisState) error
- func ValidateIdentityFields(id string, pubKey *PubKeyInfo, certificate string, credentials string, ...) error
- func ValidateRSAPubKey(pubKey []byte) error
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) GetIdentities() []Identity
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type Identity
- func (*Identity) Descriptor() ([]byte, []int)
- func (this *Identity) Equal(that interface{}) bool
- func (m *Identity) Marshal() (dAtA []byte, err error)
- func (m *Identity) MarshalTo(dAtA []byte) (int, error)
- func (m *Identity) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Identity) ProtoMessage()
- func (m *Identity) Reset()
- func (m *Identity) Size() (n int)
- func (m *Identity) String() string
- func (m *Identity) Unmarshal(dAtA []byte) error
- func (i Identity) Validate() error
- func (m *Identity) XXX_DiscardUnknown()
- func (m *Identity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Identity) XXX_Merge(src proto.Message)
- func (m *Identity) XXX_Size() int
- func (m *Identity) XXX_Unmarshal(b []byte) error
- type MsgClient
- type MsgCreateIdentity
- func (*MsgCreateIdentity) Descriptor() ([]byte, []int)
- func (this *MsgCreateIdentity) Equal(that interface{}) bool
- func (msg MsgCreateIdentity) GetSignBytes() []byte
- func (msg MsgCreateIdentity) GetSigners() []sdk.AccAddress
- func (m *MsgCreateIdentity) Marshal() (dAtA []byte, err error)
- func (m *MsgCreateIdentity) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgCreateIdentity) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgCreateIdentity) ProtoMessage()
- func (m *MsgCreateIdentity) Reset()
- func (msg MsgCreateIdentity) Route() string
- func (m *MsgCreateIdentity) Size() (n int)
- func (m *MsgCreateIdentity) String() string
- func (msg MsgCreateIdentity) Type() string
- func (m *MsgCreateIdentity) Unmarshal(dAtA []byte) error
- func (msg MsgCreateIdentity) ValidateBasic() error
- func (m *MsgCreateIdentity) XXX_DiscardUnknown()
- func (m *MsgCreateIdentity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgCreateIdentity) XXX_Merge(src proto.Message)
- func (m *MsgCreateIdentity) XXX_Size() int
- func (m *MsgCreateIdentity) XXX_Unmarshal(b []byte) error
- type MsgCreateIdentityResponse
- func (*MsgCreateIdentityResponse) Descriptor() ([]byte, []int)
- func (m *MsgCreateIdentityResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgCreateIdentityResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgCreateIdentityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgCreateIdentityResponse) ProtoMessage()
- func (m *MsgCreateIdentityResponse) Reset()
- func (m *MsgCreateIdentityResponse) Size() (n int)
- func (m *MsgCreateIdentityResponse) String() string
- func (m *MsgCreateIdentityResponse) Unmarshal(dAtA []byte) error
- func (m *MsgCreateIdentityResponse) XXX_DiscardUnknown()
- func (m *MsgCreateIdentityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgCreateIdentityResponse) XXX_Merge(src proto.Message)
- func (m *MsgCreateIdentityResponse) XXX_Size() int
- func (m *MsgCreateIdentityResponse) XXX_Unmarshal(b []byte) error
- type MsgServer
- type MsgUpdateIdentity
- func (*MsgUpdateIdentity) Descriptor() ([]byte, []int)
- func (this *MsgUpdateIdentity) Equal(that interface{}) bool
- func (msg MsgUpdateIdentity) GetSignBytes() []byte
- func (msg MsgUpdateIdentity) GetSigners() []sdk.AccAddress
- func (m *MsgUpdateIdentity) Marshal() (dAtA []byte, err error)
- func (m *MsgUpdateIdentity) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgUpdateIdentity) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgUpdateIdentity) ProtoMessage()
- func (m *MsgUpdateIdentity) Reset()
- func (msg MsgUpdateIdentity) Route() string
- func (m *MsgUpdateIdentity) Size() (n int)
- func (m *MsgUpdateIdentity) String() string
- func (msg MsgUpdateIdentity) Type() string
- func (m *MsgUpdateIdentity) Unmarshal(dAtA []byte) error
- func (msg MsgUpdateIdentity) ValidateBasic() error
- func (m *MsgUpdateIdentity) XXX_DiscardUnknown()
- func (m *MsgUpdateIdentity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgUpdateIdentity) XXX_Merge(src proto.Message)
- func (m *MsgUpdateIdentity) XXX_Size() int
- func (m *MsgUpdateIdentity) XXX_Unmarshal(b []byte) error
- type MsgUpdateIdentityResponse
- func (*MsgUpdateIdentityResponse) Descriptor() ([]byte, []int)
- func (m *MsgUpdateIdentityResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgUpdateIdentityResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgUpdateIdentityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgUpdateIdentityResponse) ProtoMessage()
- func (m *MsgUpdateIdentityResponse) Reset()
- func (m *MsgUpdateIdentityResponse) Size() (n int)
- func (m *MsgUpdateIdentityResponse) String() string
- func (m *MsgUpdateIdentityResponse) Unmarshal(dAtA []byte) error
- func (m *MsgUpdateIdentityResponse) XXX_DiscardUnknown()
- func (m *MsgUpdateIdentityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgUpdateIdentityResponse) XXX_Merge(src proto.Message)
- func (m *MsgUpdateIdentityResponse) XXX_Size() int
- func (m *MsgUpdateIdentityResponse) XXX_Unmarshal(b []byte) error
- type PubKeyAlgorithm
- type PubKeyInfo
- func (*PubKeyInfo) Descriptor() ([]byte, []int)
- func (this *PubKeyInfo) Equal(that interface{}) bool
- func (m *PubKeyInfo) Marshal() (dAtA []byte, err error)
- func (m *PubKeyInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *PubKeyInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PubKeyInfo) ProtoMessage()
- func (pki PubKeyInfo) PubKeyBytes() []byte
- func (m *PubKeyInfo) Reset()
- func (m *PubKeyInfo) Size() (n int)
- func (m *PubKeyInfo) String() string
- func (m *PubKeyInfo) Unmarshal(dAtA []byte) error
- func (pki PubKeyInfo) Validate() error
- func (m *PubKeyInfo) XXX_DiscardUnknown()
- func (m *PubKeyInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PubKeyInfo) XXX_Merge(src proto.Message)
- func (m *PubKeyInfo) XXX_Size() int
- func (m *PubKeyInfo) XXX_Unmarshal(b []byte) error
- type QueryClient
- type QueryIdentityParams
- type QueryIdentityRequest
- func (*QueryIdentityRequest) Descriptor() ([]byte, []int)
- func (m *QueryIdentityRequest) GetId() string
- func (m *QueryIdentityRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryIdentityRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryIdentityRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryIdentityRequest) ProtoMessage()
- func (m *QueryIdentityRequest) Reset()
- func (m *QueryIdentityRequest) Size() (n int)
- func (m *QueryIdentityRequest) String() string
- func (m *QueryIdentityRequest) Unmarshal(dAtA []byte) error
- func (m *QueryIdentityRequest) XXX_DiscardUnknown()
- func (m *QueryIdentityRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryIdentityRequest) XXX_Merge(src proto.Message)
- func (m *QueryIdentityRequest) XXX_Size() int
- func (m *QueryIdentityRequest) XXX_Unmarshal(b []byte) error
- type QueryIdentityResponse
- func (*QueryIdentityResponse) Descriptor() ([]byte, []int)
- func (m *QueryIdentityResponse) GetIdentity() *Identity
- func (m *QueryIdentityResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryIdentityResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryIdentityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryIdentityResponse) ProtoMessage()
- func (m *QueryIdentityResponse) Reset()
- func (m *QueryIdentityResponse) Size() (n int)
- func (m *QueryIdentityResponse) String() string
- func (m *QueryIdentityResponse) Unmarshal(dAtA []byte) error
- func (m *QueryIdentityResponse) XXX_DiscardUnknown()
- func (m *QueryIdentityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryIdentityResponse) XXX_Merge(src proto.Message)
- func (m *QueryIdentityResponse) XXX_Size() int
- func (m *QueryIdentityResponse) XXX_Unmarshal(b []byte) error
- type QueryServer
- type UnimplementedMsgServer
- type UnimplementedQueryServer
Constants ¶
const ( EventTypeCreateIdentity = "create_identity" EventTypeUpdateIdentity = "update_identity" AttributeValueCategory = ModuleName AttributeKeyID = "id" AttributeKeyOwner = "owner" )
identity module event types
const ( // ModuleName is the name of the identity module ModuleName = "identity" // StoreKey is the string store representation StoreKey string = ModuleName // QuerierRoute is the querier route for the identity module QuerierRoute string = ModuleName // RouterKey is the msg router key for the identity module RouterKey string = ModuleName )
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 IdLengthMax = 128 IdLengthMin = 3 DoNotModifyDesc = "[do-not-modify]" // description used to indicate not to modify a field )
Identity message types and params
const (
QueryIdentity = "identity" // query identity
)
Variables ¶
var ( ErrInvalidID = sdkerrors.Register(ModuleName, 2, "invalid ID") ErrInvalidPubKey = sdkerrors.Register(ModuleName, 3, "invalid public key") ErrPubKeyExists = sdkerrors.Register(ModuleName, 4, "public key already exists") ErrInvalidCertificate = sdkerrors.Register(ModuleName, 5, "invalid certificate") ErrCertificateExists = sdkerrors.Register(ModuleName, 6, "certificate already exists") ErrInvalidCredentials = sdkerrors.Register(ModuleName, 7, "invalid credentials uri") ErrIdentityExists = sdkerrors.Register(ModuleName, 8, "identity already exists") ErrUnknownIdentity = sdkerrors.Register(ModuleName, 9, "unknown identity") ErrUnsupportedPubKeyAlgorithm = sdkerrors.Register(ModuleName, 10, "unsupported public key algorithm; only RSA, DSA, ECDSA, ED25519 and SM2 supported") ErrNotAuthorized = sdkerrors.Register(ModuleName, 11, "owner not matching") )
identity module sentinel errors
var ( ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthIdentity = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowIdentity = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupIdentity = fmt.Errorf("proto: unexpected end of group") )
var ( // Keys for store prefixes OwnerKey = []byte{0x01} // prefix for identity owner PubKeyInfoKey = []byte{0x02} // prefix for public key CertificateKey = []byte{0x03} // prefix for certificate CredentialsKey = []byte{0x04} // prefix for credentials PubKeyIdentityKey = []byte{0x05} // prefix for mapping public key to identity DataKey = []byte{0x06} )
var ( ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") )
var (
ModuleCdc = codec.NewAminoCodec(amino)
)
Functions ¶
func CheckCertificate ¶
CheckCertificate checks if the given certificate is a PEM-encoded X.509 certificate and if the public key algorithm is supported
func GetCertificateKey ¶
GetCertificateKey gets the key for the certificate with the specified identity and certificate hash VALUE: []byte (certificate)
func GetCertificateSubspace ¶
GetCertificateSubspace gets the key prefix for the certificates of the specified identity
func GetCredentialsKey ¶
GetCredentialsKey gets the key for the credentials of the specified identity VALUE: []byte (credentials)
func GetDataKey ¶
GetDataKey gets the key for the data of the specified identity VALUE: []byte (data)
func GetOwnerKey ¶
GetOwnerKey gets the key for the owner of the specified identity VALUE: sdk.AccAddress (owner)
func GetPubKeyIdentityKey ¶
func GetPubKeyIdentityKey(pubKey *PubKeyInfo) []byte
GetPubKeyIdentityKey gets the key for mapping the specified public key to the identity ID VALUE: []byte (identity ID)
func GetPubKeyInfoKey ¶
func GetPubKeyInfoKey(identityID []byte, pubKey *PubKeyInfo) []byte
GetPubKeyInfoKey gets the key for the public key with the specified identity VALUE: []byte{}
func GetPubKeySubspace ¶
GetPubKeySubspace gets the key prefix for the public keys of the specified identity
func RegisterInterfaces ¶
func RegisterInterfaces(registry types.InterfaceRegistry)
func RegisterLegacyAminoCodec ¶
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec registers the necessary interfaces and concrete types on the provided Amino codec. These types are used for Amino JSON serialization.
func RegisterQueryHandler ¶
RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterQueryHandlerClient ¶
func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.
func RegisterQueryHandlerFromEndpoint ¶
func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterQueryServer ¶
func RegisterQueryServer(s grpc1.Server, srv QueryServer)
func ValidateDSAPubKey ¶
ValidateDSAPubKey validates the given DSA public key which is DER-encoded
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the provided identity genesis state to ensure the expected invariants holds.
Types ¶
type GenesisState ¶
type GenesisState struct {
Identities []Identity `protobuf:"bytes,1,rep,name=identities,proto3" json:"identities"`
}
GenesisState defines the identity module's genesis state.
func DefaultGenesisState ¶
func DefaultGenesisState() *GenesisState
DefaultGenesisState gets the raw genesis raw message for testing
func NewGenesisState ¶
func NewGenesisState(identities []Identity) *GenesisState
NewGenesisState constructs a new GenesisState instance
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) GetIdentities ¶
func (m *GenesisState) GetIdentities() []Identity
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err error)
func (*GenesisState) MarshalTo ¶
func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
func (*GenesisState) MarshalToSizedBuffer ¶
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GenesisState) ProtoMessage ¶
func (*GenesisState) ProtoMessage()
func (*GenesisState) Reset ¶
func (m *GenesisState) Reset()
func (*GenesisState) Size ¶
func (m *GenesisState) Size() (n int)
func (*GenesisState) String ¶
func (m *GenesisState) String() string
func (*GenesisState) Unmarshal ¶
func (m *GenesisState) Unmarshal(dAtA []byte) error
func (*GenesisState) XXX_DiscardUnknown ¶
func (m *GenesisState) XXX_DiscardUnknown()
func (*GenesisState) XXX_Marshal ¶
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GenesisState) XXX_Merge ¶
func (m *GenesisState) XXX_Merge(src proto.Message)
func (*GenesisState) XXX_Size ¶
func (m *GenesisState) XXX_Size() int
func (*GenesisState) XXX_Unmarshal ¶
func (m *GenesisState) XXX_Unmarshal(b []byte) error
type Identity ¶
type Identity struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" 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 string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"` Data string `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` }
Identity defines a struct for an identity
func NewIdentity ¶
func NewIdentity( id tmbytes.HexBytes, pubKeys []PubKeyInfo, certificates []string, credentials string, owner sdk.AccAddress, data string, ) Identity
NewIdentity contructs a new Identity instance
func (*Identity) MarshalToSizedBuffer ¶
func (*Identity) XXX_Marshal ¶
type MsgClient ¶
type MsgClient interface { // CreateIdentity defines a method for creating a new identity. CreateIdentity(ctx context.Context, in *MsgCreateIdentity, opts ...grpc.CallOption) (*MsgCreateIdentityResponse, error) // UpdateIdentity defines a method for Updating a identity. UpdateIdentity(ctx context.Context, in *MsgUpdateIdentity, opts ...grpc.CallOption) (*MsgUpdateIdentityResponse, error) }
MsgClient is the client API for Msg service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMsgClient ¶
func NewMsgClient(cc grpc1.ClientConn) MsgClient
type MsgCreateIdentity ¶
type MsgCreateIdentity struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" 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 string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"` Data string `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` }
MsgCreateIdentity defines a message to create an identity
func NewMsgCreateIdentity ¶
func NewMsgCreateIdentity( id tmbytes.HexBytes, pubKey *PubKeyInfo, certificate string, credentials string, owner sdk.AccAddress, data string, ) *MsgCreateIdentity
NewMsgCreateIdentity creates a new MsgCreateIdentity instance
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) Size ¶
func (m *MsgCreateIdentity) Size() (n int)
func (*MsgCreateIdentity) String ¶
func (m *MsgCreateIdentity) String() string
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 MsgCreateIdentityResponse ¶
type MsgCreateIdentityResponse struct { }
MsgCreateIdentityResponse defines the Msg/Create response type.
func (*MsgCreateIdentityResponse) Descriptor ¶
func (*MsgCreateIdentityResponse) Descriptor() ([]byte, []int)
func (*MsgCreateIdentityResponse) Marshal ¶
func (m *MsgCreateIdentityResponse) Marshal() (dAtA []byte, err error)
func (*MsgCreateIdentityResponse) MarshalTo ¶
func (m *MsgCreateIdentityResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgCreateIdentityResponse) MarshalToSizedBuffer ¶
func (m *MsgCreateIdentityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgCreateIdentityResponse) ProtoMessage ¶
func (*MsgCreateIdentityResponse) ProtoMessage()
func (*MsgCreateIdentityResponse) Reset ¶
func (m *MsgCreateIdentityResponse) Reset()
func (*MsgCreateIdentityResponse) Size ¶
func (m *MsgCreateIdentityResponse) Size() (n int)
func (*MsgCreateIdentityResponse) String ¶
func (m *MsgCreateIdentityResponse) String() string
func (*MsgCreateIdentityResponse) Unmarshal ¶
func (m *MsgCreateIdentityResponse) Unmarshal(dAtA []byte) error
func (*MsgCreateIdentityResponse) XXX_DiscardUnknown ¶
func (m *MsgCreateIdentityResponse) XXX_DiscardUnknown()
func (*MsgCreateIdentityResponse) XXX_Marshal ¶
func (m *MsgCreateIdentityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgCreateIdentityResponse) XXX_Merge ¶
func (m *MsgCreateIdentityResponse) XXX_Merge(src proto.Message)
func (*MsgCreateIdentityResponse) XXX_Size ¶
func (m *MsgCreateIdentityResponse) XXX_Size() int
func (*MsgCreateIdentityResponse) XXX_Unmarshal ¶
func (m *MsgCreateIdentityResponse) XXX_Unmarshal(b []byte) error
type MsgServer ¶
type MsgServer interface { // CreateIdentity defines a method for creating a new identity. CreateIdentity(context.Context, *MsgCreateIdentity) (*MsgCreateIdentityResponse, error) // UpdateIdentity defines a method for Updating a identity. UpdateIdentity(context.Context, *MsgUpdateIdentity) (*MsgUpdateIdentityResponse, error) }
MsgServer is the server API for Msg service.
type MsgUpdateIdentity ¶
type MsgUpdateIdentity struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" 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 string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"` Data string `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` }
MsgUpdateIdentity defines a message to update an identity
func NewMsgUpdateIdentity ¶
func NewMsgUpdateIdentity( id tmbytes.HexBytes, pubKey *PubKeyInfo, certificate string, credentials string, owner sdk.AccAddress, data string, ) *MsgUpdateIdentity
NewMsgUpdateIdentity creates a new MsgUpdateIdentity instance
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) Size ¶
func (m *MsgUpdateIdentity) Size() (n int)
func (*MsgUpdateIdentity) String ¶
func (m *MsgUpdateIdentity) String() string
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 MsgUpdateIdentityResponse ¶
type MsgUpdateIdentityResponse struct { }
MsgUpdateIdentityResponse defines the Msg/Update response type.
func (*MsgUpdateIdentityResponse) Descriptor ¶
func (*MsgUpdateIdentityResponse) Descriptor() ([]byte, []int)
func (*MsgUpdateIdentityResponse) Marshal ¶
func (m *MsgUpdateIdentityResponse) Marshal() (dAtA []byte, err error)
func (*MsgUpdateIdentityResponse) MarshalTo ¶
func (m *MsgUpdateIdentityResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgUpdateIdentityResponse) MarshalToSizedBuffer ¶
func (m *MsgUpdateIdentityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgUpdateIdentityResponse) ProtoMessage ¶
func (*MsgUpdateIdentityResponse) ProtoMessage()
func (*MsgUpdateIdentityResponse) Reset ¶
func (m *MsgUpdateIdentityResponse) Reset()
func (*MsgUpdateIdentityResponse) Size ¶
func (m *MsgUpdateIdentityResponse) Size() (n int)
func (*MsgUpdateIdentityResponse) String ¶
func (m *MsgUpdateIdentityResponse) String() string
func (*MsgUpdateIdentityResponse) Unmarshal ¶
func (m *MsgUpdateIdentityResponse) Unmarshal(dAtA []byte) error
func (*MsgUpdateIdentityResponse) XXX_DiscardUnknown ¶
func (m *MsgUpdateIdentityResponse) XXX_DiscardUnknown()
func (*MsgUpdateIdentityResponse) XXX_Marshal ¶
func (m *MsgUpdateIdentityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgUpdateIdentityResponse) XXX_Merge ¶
func (m *MsgUpdateIdentityResponse) XXX_Merge(src proto.Message)
func (*MsgUpdateIdentityResponse) XXX_Size ¶
func (m *MsgUpdateIdentityResponse) XXX_Size() int
func (*MsgUpdateIdentityResponse) XXX_Unmarshal ¶
func (m *MsgUpdateIdentityResponse) 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 PubKeyAlgorithmFromString ¶
func PubKeyAlgorithmFromString(str string) PubKeyAlgorithm
PubKeyAlgorithmFromString converts the given string to PubKeyAlgorithm
func (PubKeyAlgorithm) EnumDescriptor ¶
func (PubKeyAlgorithm) EnumDescriptor() ([]byte, []int)
func (PubKeyAlgorithm) MarshalJSON ¶
func (p PubKeyAlgorithm) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON representation
func (PubKeyAlgorithm) MarshalYAML ¶
func (p PubKeyAlgorithm) MarshalYAML() (interface{}, error)
MarshalYAML returns the YAML representation
func (PubKeyAlgorithm) String ¶
func (x PubKeyAlgorithm) String() string
func (*PubKeyAlgorithm) UnmarshalJSON ¶
func (p *PubKeyAlgorithm) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals raw JSON bytes into a PubKeyAlgorithm
type PubKeyInfo ¶
type PubKeyInfo struct { PubKey string `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pubkey" yaml:"pubkey"` Algorithm PubKeyAlgorithm `protobuf:"varint,2,opt,name=algorithm,proto3,enum=iritamod.identity.PubKeyAlgorithm" json:"algorithm,omitempty"` }
PubKey represents a public key along with the corresponding algorithm
func GetPubKeyFromCertificate ¶
func GetPubKeyFromCertificate(cert []byte) *PubKeyInfo
GetPubKeyFromCertificate retrieves the public key from the given certificate Note: make sure that the certificate is valid
func NewPubKeyInfo ¶
func NewPubKeyInfo(pubKey tmbytes.HexBytes, algorithm PubKeyAlgorithm) PubKeyInfo
NewPubKeyInfo constructs a new PubKeyInfo instance
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) PubKeyBytes ¶
func (pki PubKeyInfo) PubKeyBytes() []byte
PubKeyBytes return the hex bytes of the PubKey
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) Validate ¶
func (pki PubKeyInfo) Validate() error
Validate validates the public key against underlying constraints which vary by the algorithm
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 QueryClient ¶
type QueryClient interface { // Identity queries the identity by the given id Identity(ctx context.Context, in *QueryIdentityRequest, opts ...grpc.CallOption) (*QueryIdentityResponse, error) }
QueryClient is the client API for Query service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewQueryClient ¶
func NewQueryClient(cc grpc1.ClientConn) QueryClient
type QueryIdentityParams ¶
type QueryIdentityParams struct {
ID string
}
QueryIdentityParams defines the params to query an identity
type QueryIdentityRequest ¶
type QueryIdentityRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}
QueryIdentityRequest is request type for the Query/Identity RPC method
func (*QueryIdentityRequest) Descriptor ¶
func (*QueryIdentityRequest) Descriptor() ([]byte, []int)
func (*QueryIdentityRequest) GetId ¶
func (m *QueryIdentityRequest) GetId() string
func (*QueryIdentityRequest) Marshal ¶
func (m *QueryIdentityRequest) Marshal() (dAtA []byte, err error)
func (*QueryIdentityRequest) MarshalTo ¶
func (m *QueryIdentityRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryIdentityRequest) MarshalToSizedBuffer ¶
func (m *QueryIdentityRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryIdentityRequest) ProtoMessage ¶
func (*QueryIdentityRequest) ProtoMessage()
func (*QueryIdentityRequest) Reset ¶
func (m *QueryIdentityRequest) Reset()
func (*QueryIdentityRequest) Size ¶
func (m *QueryIdentityRequest) Size() (n int)
func (*QueryIdentityRequest) String ¶
func (m *QueryIdentityRequest) String() string
func (*QueryIdentityRequest) Unmarshal ¶
func (m *QueryIdentityRequest) Unmarshal(dAtA []byte) error
func (*QueryIdentityRequest) XXX_DiscardUnknown ¶
func (m *QueryIdentityRequest) XXX_DiscardUnknown()
func (*QueryIdentityRequest) XXX_Marshal ¶
func (m *QueryIdentityRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryIdentityRequest) XXX_Merge ¶
func (m *QueryIdentityRequest) XXX_Merge(src proto.Message)
func (*QueryIdentityRequest) XXX_Size ¶
func (m *QueryIdentityRequest) XXX_Size() int
func (*QueryIdentityRequest) XXX_Unmarshal ¶
func (m *QueryIdentityRequest) XXX_Unmarshal(b []byte) error
type QueryIdentityResponse ¶
type QueryIdentityResponse struct {
Identity *Identity `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
}
QueryIdentityResponse is response type for the Query/Identity RPC method
func (*QueryIdentityResponse) Descriptor ¶
func (*QueryIdentityResponse) Descriptor() ([]byte, []int)
func (*QueryIdentityResponse) GetIdentity ¶
func (m *QueryIdentityResponse) GetIdentity() *Identity
func (*QueryIdentityResponse) Marshal ¶
func (m *QueryIdentityResponse) Marshal() (dAtA []byte, err error)
func (*QueryIdentityResponse) MarshalTo ¶
func (m *QueryIdentityResponse) MarshalTo(dAtA []byte) (int, error)
func (*QueryIdentityResponse) MarshalToSizedBuffer ¶
func (m *QueryIdentityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryIdentityResponse) ProtoMessage ¶
func (*QueryIdentityResponse) ProtoMessage()
func (*QueryIdentityResponse) Reset ¶
func (m *QueryIdentityResponse) Reset()
func (*QueryIdentityResponse) Size ¶
func (m *QueryIdentityResponse) Size() (n int)
func (*QueryIdentityResponse) String ¶
func (m *QueryIdentityResponse) String() string
func (*QueryIdentityResponse) Unmarshal ¶
func (m *QueryIdentityResponse) Unmarshal(dAtA []byte) error
func (*QueryIdentityResponse) XXX_DiscardUnknown ¶
func (m *QueryIdentityResponse) XXX_DiscardUnknown()
func (*QueryIdentityResponse) XXX_Marshal ¶
func (m *QueryIdentityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryIdentityResponse) XXX_Merge ¶
func (m *QueryIdentityResponse) XXX_Merge(src proto.Message)
func (*QueryIdentityResponse) XXX_Size ¶
func (m *QueryIdentityResponse) XXX_Size() int
func (*QueryIdentityResponse) XXX_Unmarshal ¶
func (m *QueryIdentityResponse) XXX_Unmarshal(b []byte) error
type QueryServer ¶
type QueryServer interface { // Identity queries the identity by the given id Identity(context.Context, *QueryIdentityRequest) (*QueryIdentityResponse, error) }
QueryServer is the server API for Query service.
type UnimplementedMsgServer ¶
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgServer) CreateIdentity ¶
func (*UnimplementedMsgServer) CreateIdentity(ctx context.Context, req *MsgCreateIdentity) (*MsgCreateIdentityResponse, error)
func (*UnimplementedMsgServer) UpdateIdentity ¶
func (*UnimplementedMsgServer) UpdateIdentity(ctx context.Context, req *MsgUpdateIdentity) (*MsgUpdateIdentityResponse, error)
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.
func (*UnimplementedQueryServer) Identity ¶
func (*UnimplementedQueryServer) Identity(ctx context.Context, req *QueryIdentityRequest) (*QueryIdentityResponse, error)