Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateMnemonic() (string, error)
- func UnprefixedDid(did Did) string
- func UnprefixedDidFromPubKey(pubKey string) string
- func VerifyKeyToAddr(verifyKey string) sdk.AccAddress
- type BaseDidDoc
- func (*BaseDidDoc) Descriptor() ([]byte, []int)
- func (m *BaseDidDoc) Marshal() (dAtA []byte, err error)
- func (m *BaseDidDoc) MarshalTo(dAtA []byte) (int, error)
- func (m *BaseDidDoc) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*BaseDidDoc) ProtoMessage()
- func (m *BaseDidDoc) Reset()
- func (m *BaseDidDoc) Size() (n int)
- func (m *BaseDidDoc) String() string
- func (m *BaseDidDoc) Unmarshal(dAtA []byte) error
- func (m *BaseDidDoc) XXX_DiscardUnknown()
- func (m *BaseDidDoc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BaseDidDoc) XXX_Merge(src proto.Message)
- func (m *BaseDidDoc) XXX_Size() int
- func (m *BaseDidDoc) XXX_Unmarshal(b []byte) error
- type Claim
- func (*Claim) Descriptor() ([]byte, []int)
- func (m *Claim) GetId() string
- func (m *Claim) GetKYCValidated() bool
- func (m *Claim) Marshal() (dAtA []byte, err error)
- func (m *Claim) MarshalTo(dAtA []byte) (int, error)
- func (m *Claim) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Claim) ProtoMessage()
- func (m *Claim) Reset()
- func (m *Claim) Size() (n int)
- func (m *Claim) String() string
- func (m *Claim) Unmarshal(dAtA []byte) error
- func (m *Claim) XXX_DiscardUnknown()
- func (m *Claim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Claim) XXX_Merge(src proto.Message)
- func (m *Claim) XXX_Size() int
- func (m *Claim) XXX_Unmarshal(b []byte) error
- type Did
- type DidCredential
- func (*DidCredential) Descriptor() ([]byte, []int)
- func (m *DidCredential) GetClaim() *Claim
- func (m *DidCredential) GetCredType() []string
- func (m *DidCredential) GetIssued() string
- func (m *DidCredential) GetIssuer() string
- func (m *DidCredential) Marshal() (dAtA []byte, err error)
- func (m *DidCredential) MarshalTo(dAtA []byte) (int, error)
- func (m *DidCredential) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*DidCredential) ProtoMessage()
- func (m *DidCredential) Reset()
- func (m *DidCredential) Size() (n int)
- func (m *DidCredential) String() string
- func (m *DidCredential) Unmarshal(dAtA []byte) error
- func (m *DidCredential) XXX_DiscardUnknown()
- func (m *DidCredential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DidCredential) XXX_Merge(src proto.Message)
- func (m *DidCredential) XXX_Size() int
- func (m *DidCredential) XXX_Unmarshal(b []byte) error
- type DidDoc
- type FuryDid
- func (id FuryDid) Address() sdk.AccAddress
- func (*FuryDid) Descriptor() ([]byte, []int)
- func (id FuryDid) Equals(other FuryDid) bool
- func (m *FuryDid) GetDid() string
- func (m *FuryDid) GetEncryptionPublicKey() string
- func (m *FuryDid) GetSecret() *Secret
- func (m *FuryDid) GetVerifyKey() string
- func (m *FuryDid) Marshal() (dAtA []byte, err error)
- func (m *FuryDid) MarshalTo(dAtA []byte) (int, error)
- func (m *FuryDid) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*FuryDid) ProtoMessage()
- func (m *FuryDid) Reset()
- func (id FuryDid) SignMessage(msg []byte) ([]byte, error)
- func (m *FuryDid) Size() (n int)
- func (m *FuryDid) String() string
- func (m *FuryDid) Unmarshal(dAtA []byte) error
- func (id FuryDid) VerifySignedMessage(msg []byte, sig []byte) bool
- func (m *FuryDid) XXX_DiscardUnknown()
- func (m *FuryDid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FuryDid) XXX_Merge(src proto.Message)
- func (m *FuryDid) XXX_Size() int
- func (m *FuryDid) XXX_Unmarshal(b []byte) error
- type Secret
- func (*Secret) Descriptor() ([]byte, []int)
- func (s Secret) Equals(other Secret) bool
- func (m *Secret) GetEncryptionPrivateKey() string
- func (m *Secret) GetSeed() string
- func (m *Secret) GetSignKey() string
- func (m *Secret) Marshal() (dAtA []byte, err error)
- func (m *Secret) MarshalTo(dAtA []byte) (int, error)
- func (m *Secret) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Secret) ProtoMessage()
- func (m *Secret) Reset()
- func (m *Secret) Size() (n int)
- func (m *Secret) String() string
- func (m *Secret) Unmarshal(dAtA []byte) error
- func (m *Secret) XXX_DiscardUnknown()
- func (m *Secret) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Secret) XXX_Merge(src proto.Message)
- func (m *Secret) XXX_Size() int
- func (m *Secret) XXX_Unmarshal(b []byte) error
Constants ¶
View Source
const (
DefaultCodespace = "fury.lib.legacydid"
)
Variables ¶
View Source
var ( ValidDid = regexp.MustCompile(`^did\:[a-z0-9]+\:(?:([A-Z.a-z0-9]|\-|_|%[0-9A-Fa-f][0-9A-Fa-f])*\:)*(?:[A-Z.a-z0-9]|\-|_|%[0-9A-Fa-f][0-9A-Fa-f])+(?:#[a-zA-Z0-9-\._]+)?$`) ValidPubKey = regexp.MustCompile(`^[123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ]{43,44}$`) IsValidDid = ValidDid.MatchString IsValidPubKey = ValidPubKey.MatchString )
View Source
var ( ErrInvalidLengthDid = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowDid = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupDid = fmt.Errorf("proto: unexpected end of group") )
View Source
var ( ErrInvalidLengthDiddoc = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowDiddoc = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupDiddoc = fmt.Errorf("proto: unexpected end of group") )
View Source
var ( ErrInvalidDid = sdkerrors.Register(DefaultCodespace, 2, "invalid did") ErrInvalidPubKey = sdkerrors.Register(DefaultCodespace, 3, "invalid pubKey") ErrDidPubKeyMismatch = sdkerrors.Register(DefaultCodespace, 4, "did pubKey mismatch") ErrInvalidIssuer = sdkerrors.Register(DefaultCodespace, 5, "invalid issuer") ErrInvalidCredentials = sdkerrors.Register(DefaultCodespace, 6, "invalid credentials") ErrInvalidClaimId = sdkerrors.Register(DefaultCodespace, 7, "invalid claim ID") )
View Source
var DidPrefix = "did:fury:"
Functions ¶
func GenerateMnemonic ¶
func UnprefixedDid ¶
func UnprefixedDidFromPubKey ¶
func VerifyKeyToAddr ¶
func VerifyKeyToAddr(verifyKey string) sdk.AccAddress
Types ¶
type BaseDidDoc ¶
type BaseDidDoc struct { Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty" yaml:"did"` PubKey string `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pubKey" yaml:"pubKey"` Credentials []*DidCredential `protobuf:"bytes,3,rep,name=credentials,proto3" json:"credentials,omitempty" yaml:"credentials"` }
BaseDidDoc defines a base DID document type. It implements the DidDoc interface.
func (*BaseDidDoc) Descriptor ¶
func (*BaseDidDoc) Descriptor() ([]byte, []int)
func (*BaseDidDoc) Marshal ¶
func (m *BaseDidDoc) Marshal() (dAtA []byte, err error)
func (*BaseDidDoc) MarshalToSizedBuffer ¶
func (m *BaseDidDoc) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BaseDidDoc) ProtoMessage ¶
func (*BaseDidDoc) ProtoMessage()
func (*BaseDidDoc) Reset ¶
func (m *BaseDidDoc) Reset()
func (*BaseDidDoc) Size ¶
func (m *BaseDidDoc) Size() (n int)
func (*BaseDidDoc) String ¶
func (m *BaseDidDoc) String() string
func (*BaseDidDoc) Unmarshal ¶
func (m *BaseDidDoc) Unmarshal(dAtA []byte) error
func (*BaseDidDoc) XXX_DiscardUnknown ¶
func (m *BaseDidDoc) XXX_DiscardUnknown()
func (*BaseDidDoc) XXX_Marshal ¶
func (m *BaseDidDoc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BaseDidDoc) XXX_Merge ¶
func (m *BaseDidDoc) XXX_Merge(src proto.Message)
func (*BaseDidDoc) XXX_Size ¶
func (m *BaseDidDoc) XXX_Size() int
func (*BaseDidDoc) XXX_Unmarshal ¶
func (m *BaseDidDoc) XXX_Unmarshal(b []byte) error
type Claim ¶
type Claim struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` KYCValidated bool `protobuf:"varint,2,opt,name=KYC_validated,json=KYCValidated,proto3" json:"KYCValidated" yaml:"KYCValidated"` }
The claim section of a credential, indicating if the DID is KYC validated
func (*Claim) Descriptor ¶
func (*Claim) GetKYCValidated ¶
func (*Claim) ProtoMessage ¶
func (*Claim) ProtoMessage()
func (*Claim) XXX_DiscardUnknown ¶
func (m *Claim) XXX_DiscardUnknown()
func (*Claim) XXX_Marshal ¶
func (*Claim) XXX_Unmarshal ¶
type DidCredential ¶
type DidCredential struct { CredType []string `protobuf:"bytes,1,rep,name=cred_type,json=credType,proto3" json:"type" yaml:"type"` Issuer string `protobuf:"bytes,2,opt,name=issuer,proto3" json:"issuer,omitempty" yaml:"issuer"` Issued string `protobuf:"bytes,3,opt,name=issued,proto3" json:"issued,omitempty" yaml:"issued"` Claim *Claim `protobuf:"bytes,4,opt,name=claim,proto3" json:"claim,omitempty" yaml:"claim"` }
Digital identity credential issued to an fury DID
func (*DidCredential) Descriptor ¶
func (*DidCredential) Descriptor() ([]byte, []int)
func (*DidCredential) GetClaim ¶
func (m *DidCredential) GetClaim() *Claim
func (*DidCredential) GetCredType ¶
func (m *DidCredential) GetCredType() []string
func (*DidCredential) GetIssued ¶
func (m *DidCredential) GetIssued() string
func (*DidCredential) GetIssuer ¶
func (m *DidCredential) GetIssuer() string
func (*DidCredential) Marshal ¶
func (m *DidCredential) Marshal() (dAtA []byte, err error)
func (*DidCredential) MarshalToSizedBuffer ¶
func (m *DidCredential) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*DidCredential) ProtoMessage ¶
func (*DidCredential) ProtoMessage()
func (*DidCredential) Reset ¶
func (m *DidCredential) Reset()
func (*DidCredential) Size ¶
func (m *DidCredential) Size() (n int)
func (*DidCredential) String ¶
func (m *DidCredential) String() string
func (*DidCredential) Unmarshal ¶
func (m *DidCredential) Unmarshal(dAtA []byte) error
func (*DidCredential) XXX_DiscardUnknown ¶
func (m *DidCredential) XXX_DiscardUnknown()
func (*DidCredential) XXX_Marshal ¶
func (m *DidCredential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DidCredential) XXX_Merge ¶
func (m *DidCredential) XXX_Merge(src proto.Message)
func (*DidCredential) XXX_Size ¶
func (m *DidCredential) XXX_Size() int
func (*DidCredential) XXX_Unmarshal ¶
func (m *DidCredential) XXX_Unmarshal(b []byte) error
type FuryDid ¶
type FuryDid struct { Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty" yaml:"did"` VerifyKey string `protobuf:"bytes,2,opt,name=verify_key,json=verifyKey,proto3" json:"verifyKey" yaml:"verifyKey"` EncryptionPublicKey string `` /* 135-byte string literal not displayed */ Secret *Secret `protobuf:"bytes,4,opt,name=secret,proto3" json:"secret,omitempty" yaml:"secret"` }
An fury DID with public and private keys, based on the Sovrin DID spec
func FromMnemonic ¶
func NewFuryDid ¶
func UnmarshalFuryDid ¶
func (FuryDid) Address ¶
func (id FuryDid) Address() sdk.AccAddress
func (*FuryDid) Descriptor ¶
func (*FuryDid) GetEncryptionPublicKey ¶
func (*FuryDid) GetVerifyKey ¶
func (*FuryDid) MarshalToSizedBuffer ¶
func (*FuryDid) ProtoMessage ¶
func (*FuryDid) ProtoMessage()
func (FuryDid) VerifySignedMessage ¶
func (*FuryDid) XXX_DiscardUnknown ¶
func (m *FuryDid) XXX_DiscardUnknown()
func (*FuryDid) XXX_Marshal ¶
func (*FuryDid) XXX_Unmarshal ¶
type Secret ¶
type Secret struct { Seed string `protobuf:"bytes,1,opt,name=seed,proto3" json:"seed,omitempty" yaml:"seed"` SignKey string `protobuf:"bytes,2,opt,name=sign_key,json=signKey,proto3" json:"signKey" yaml:"signKey"` EncryptionPrivateKey string `` /* 139-byte string literal not displayed */ }
The private section of an fury DID, based on the Sovrin DID spec
func (*Secret) Descriptor ¶
func (*Secret) GetEncryptionPrivateKey ¶
func (*Secret) GetSignKey ¶
func (*Secret) MarshalToSizedBuffer ¶
func (*Secret) ProtoMessage ¶
func (*Secret) ProtoMessage()
func (*Secret) XXX_DiscardUnknown ¶
func (m *Secret) XXX_DiscardUnknown()
func (*Secret) XXX_Marshal ¶
func (*Secret) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.