Documentation ¶
Index ¶
- Constants
- Variables
- func CheckSignature(iDateContainer interfaces.IDataContainer, ...) error
- func CreateCRIDContractByCode(code []byte) (*contract.Contract, error)
- func GetCodeByPubKey(publicKey []byte) ([]byte, error)
- func GetController(uriPublic string) (string, string)
- func GetDIDAddress(publicKey []byte) (string, error)
- func GetDIDFromUri(idURI string) string
- func IsCompact(target string) bool
- func IsDID(ID string, publicKey []DIDPublicKeyInfo) bool
- func IsMatched(publicKey []byte, did string) bool
- func IsPublickDIDMatched(PublicKeyBase58 string, did string) bool
- func VerifyByVM(iDateContainer interfaces.IDataContainer, code []byte, signature []byte) (bool, error)
- type CredentialProof
- type CustomIDTicket
- type CustomIDTicketData
- type DIDDoc
- type DIDParams
- type DIDPayload
- type DIDPayloadData
- type DIDPublicKeyInfo
- type DIDTransactionData
- type DocProof
- type Header
- type Proof
- type Service
- type TicketProof
- type VerifiableCredential
- type VerifiableCredentialData
- type VerifiableCredentialDoc
- type VerifiableCredentialTxData
Constants ¶
View Source
const ( Create_DID_Operation = "create" Update_DID_Operation = "update" Transfer_DID_Operation = "transfer" Deactivate_DID_Operation = "deactivate" Declare_Verifiable_Credential_Operation = "declare" Revoke_Verifiable_Credential_Operation = "revoke" DID_ELASTOS_PREFIX = "did:elastos:" ID_STRING = "id" )
View Source
const DIDVersion = 0x00
View Source
const FeeRate int64 = 10000000000
View Source
const PrefixCRDID contract.PrefixType = 0x67
View Source
const VerifiableCredentialVersion = 0x00
Variables ¶
View Source
var MainNetDIDParams = DIDParams{
CustomIDFeeRate: 50000,
}
View Source
var RegNetDIDParams = DIDParams{
CustomIDFeeRate: 50000,
}
View Source
var TestNetDIDParams = DIDParams{
CustomIDFeeRate: 50000,
}
Functions ¶
func CheckSignature ¶
func CheckSignature(iDateContainer interfaces.IDataContainer, publickBase58, signatureBase64 string) error
func GetCodeByPubKey ¶
func GetController ¶
URI Public string like verification method and creator and so on
func GetDIDAddress ¶
func GetDIDFromUri ¶
func IsDID ¶
func IsDID(ID string, publicKey []DIDPublicKeyInfo) bool
func IsPublickDIDMatched ¶
func VerifyByVM ¶
func VerifyByVM(iDateContainer interfaces.IDataContainer, code []byte, signature []byte) (bool, error)
Types ¶
type CredentialProof ¶
type CredentialProof struct { Type string `json:"type,omitempty"` Created string `json:"created,omitempty"` VerificationMethod string `json:"verificationMethod"` Nonce string `json:"nonce,omitempty"` Realm string `json:"realm,omitempty"` Signature string `json:"signature"` }
Proof of DID transaction payload
type CustomIDTicket ¶
type CustomIDTicket struct { *CustomIDTicketData Proof interface{} `json:"proof"` }
func (*CustomIDTicket) GetData ¶
func (c *CustomIDTicket) GetData() []byte
type CustomIDTicketData ¶
type CustomIDTicketData struct { CustomID string `json:"id"` To string `json:"to"` TransactionID string `json:"txid"` }
func (*CustomIDTicketData) GetData ¶
func (c *CustomIDTicketData) GetData() []byte
type DIDDoc ¶
type DIDDoc struct { *DIDPayloadData Proof interface{} `json:"proof,omitempty"` }
payload in DID transaction payload
type DIDPayload ¶
type DIDPayload struct { Header Header `json:"header"` Payload string `json:"payload"` Proof Proof `json:"proof"` DIDDoc *DIDDoc CredentialDoc *VerifiableCredentialDoc Ticket *CustomIDTicket }
payload of DID transaction
func (*DIDPayload) Data ¶
func (p *DIDPayload) Data(version byte) []byte
func (*DIDPayload) Deserialize ¶
func (p *DIDPayload) Deserialize(r io.Reader, version byte) error
func (*DIDPayload) GetDIDDoc ¶
func (p *DIDPayload) GetDIDDoc() *DIDDoc
func (*DIDPayload) GetData ¶
func (p *DIDPayload) GetData() []byte
type DIDPayloadData ¶
type DIDPayloadData struct { ID string `json:"id"` Controller interface{} `json:"controller,omitempty"` MultiSig string `json:"multisig,omitempty"` PublicKey []DIDPublicKeyInfo `json:"publicKey,omitempty"` Authentication []interface{} `json:"authentication,omitempty"` Authorization []interface{} `json:"authorization,omitempty"` VerifiableCredential []VerifiableCredential `json:"verifiableCredential,omitempty"` Service []Service `json:"service,omitempty"` Expires string `json:"expires"` }
func (*DIDPayloadData) GetData ¶
func (c *DIDPayloadData) GetData() []byte
type DIDPublicKeyInfo ¶
type DIDPublicKeyInfo struct { ID string `json:"id"` Type string `json:"type"` Controller string `json:"controller"` PublicKeyBase58 string `json:"publicKeyBase58"` }
public keys of payload in DID transaction payload
func (*DIDPublicKeyInfo) Deserialize ¶
func (p *DIDPublicKeyInfo) Deserialize(r io.Reader, version byte) error
type DIDTransactionData ¶
type DIDTransactionData struct { TXID string `json:"txid"` Timestamp string `json:"timestamp"` Operation DIDPayload `json:"operation"` }
type DocProof ¶
type DocProof struct { Type string `json:"type,omitempty"` Created string `json:"created"` Creator string `json:"creator"` SignatureValue string `json:"signatureValue"` }
Proof of DID transaction doc
type Header ¶
type Header struct { Specification string `json:"specification"` Operation string `json:"operation"` PreviousTxid string `json:"previousTxid,omitempty"` Ticket string `json:"ticket,omitempty"` }
header of Customized DID transaction payload
type Proof ¶
type Proof struct { Type string `json:"type,omitempty"` VerificationMethod string `json:"verificationMethod"` Signature string `json:"signature"` }
Proof of DID transaction payload
type TicketProof ¶
type TicketProof struct { Type string `json:"type,omitempty"` Created string `json:"created"` VerificationMethod string `json:"verificationMethod"` Signature string `json:"signature"` }
Proof of DID transaction ticket
type VerifiableCredential ¶
type VerifiableCredential struct { *VerifiableCredentialData Proof CredentialProof `json:"proof,omitempty"` }
func (*VerifiableCredential) CompleteCompact ¶
func (p *VerifiableCredential) CompleteCompact(did string)
func (*VerifiableCredential) GetDIDProofInfo ¶
func (p *VerifiableCredential) GetDIDProofInfo() *CredentialProof
type VerifiableCredentialData ¶
type VerifiableCredentialData struct { ID string `json:"id"` Type []string `json:"type,omitempty"` Issuer string `json:"issuer,omitempty"` IssuanceDate string `json:"issuanceDate,omitempty"` ExpirationDate string `json:"expirationDate,omitempty"` CredentialSubject interface{} `json:"credentialSubject,omitempty"` }
func (*VerifiableCredentialData) GetData ¶
func (p *VerifiableCredentialData) GetData() []byte
type VerifiableCredentialDoc ¶
type VerifiableCredentialDoc struct {
*VerifiableCredential `json:"verifiableCredential,omitempty"`
}
type VerifiableCredentialTxData ¶
type VerifiableCredentialTxData struct { TXID string `json:"txid"` Timestamp string `json:"timestamp"` Operation DIDPayload `json:"operation"` }
Click to show internal directories.
Click to hide internal directories.