Documentation ¶
Index ¶
- Constants
- func StringArray(entry interface{}) []string
- type DIDDocument
- func (doc DIDDocument) AgreementKeys() []interface{}
- func (doc DIDDocument) AlsoKnownAs() []string
- func (doc DIDDocument) AssertionMethods() []interface{}
- func (doc DIDDocument) Authentications() []interface{}
- func (doc DIDDocument) Context() []interface{}
- func (doc DIDDocument) DelegationKeys() []interface{}
- func (doc DIDDocument) ID() string
- func (doc DIDDocument) InvocationKeys() []interface{}
- func (doc DIDDocument) JSONLdObject() map[string]interface{}
- func (doc DIDDocument) PublicKeys() []PublicKey
- func (doc DIDDocument) Services() []Service
- func (doc DIDDocument) VerificationMethods() []PublicKey
- type Document
- type JWK
- type KeyPurpose
- type Metadata
- type PublicKey
- func (pk PublicKey) Controller() string
- func (pk PublicKey) ID() string
- func (pk PublicKey) JSONLdObject() map[string]interface{}
- func (pk PublicKey) PublicKeyBase58() string
- func (pk PublicKey) PublicKeyJwk() JWK
- func (pk PublicKey) PublicKeyMultibase() string
- func (pk PublicKey) Purpose() []string
- func (pk PublicKey) Type() string
- type ReplaceDocument
- type ResolutionOption
- type ResolutionOptions
- type ResolutionResult
- type Service
Constants ¶
const ( // ContextProperty defines key for context property. ContextProperty = "@context" // AlsoKnownAs defines also known as property. AlsoKnownAs = "alsoKnownAs" // ServiceProperty defines key for service property. ServiceProperty = "service" // PublicKeyProperty defines key for public key property. PublicKeyProperty = "publicKey" // VerificationMethodProperty defines key for verification method. VerificationMethodProperty = "verificationMethod" // AuthenticationProperty defines key for authentication property. AuthenticationProperty = "authentication" // AssertionMethodProperty defines key for assertion method property. AssertionMethodProperty = "assertionMethod" // KeyAgreementProperty defines key for key agreement property. KeyAgreementProperty = "keyAgreement" // DelegationKeyProperty defines key for delegation key property. DelegationKeyProperty = "capabilityDelegation" // InvocationKeyProperty defines key for invocation key property. InvocationKeyProperty = "capabilityInvocation" )
const ( // ControllerProperty defines key for controller. ControllerProperty = "controller" // PurposesProperty describes key purposes property. PurposesProperty = "purposes" // PublicKeyJwkProperty describes external public key JWK. PublicKeyJwkProperty = "publicKeyJwk" // TypeProperty describes type. TypeProperty = "type" // PublicKeyBase58Property defines base 58 encoding for public key. PublicKeyBase58Property = "publicKeyBase58" // PublicKeyMultibaseProperty defines base multibase for public key. PublicKeyMultibaseProperty = "publicKeyMultibase" )
const ( // KeyPurposeAuthentication defines key purpose as authentication key. KeyPurposeAuthentication = "authentication" // KeyPurposeAssertionMethod defines key purpose as assertion key. KeyPurposeAssertionMethod = "assertionMethod" // KeyPurposeKeyAgreement defines key purpose as agreement key. KeyPurposeKeyAgreement = "keyAgreement" // KeyPurposeCapabilityDelegation defines key purpose as delegation key. KeyPurposeCapabilityDelegation = "capabilityDelegation" // KeyPurposeCapabilityInvocation defines key purpose as invocation key. KeyPurposeCapabilityInvocation = "capabilityInvocation" )
const ( // ReplaceServiceProperty defines key for service property. ReplaceServiceProperty = "services" // ReplacePublicKeyProperty defines key for public key property. ReplacePublicKeyProperty = "publicKeys" )
const ( // UpdateCommitmentProperty is update commitment key. UpdateCommitmentProperty = "updateCommitment" // RecoveryCommitmentProperty is recovery commitment key. RecoveryCommitmentProperty = "recoveryCommitment" // PublishedProperty is published key. PublishedProperty = "published" // DeactivatedProperty is deactivated flag key. DeactivatedProperty = "deactivated" // AnchorOriginProperty is anchor origin key. AnchorOriginProperty = "anchorOrigin" // CreatedProperty is the time that document was created - anchoring time of first successful create operation. CreatedProperty = "created" // UpdatedProperty is the time of last document update - anchoring time of update/recover operations. UpdatedProperty = "updated" // VersionIDProperty is version ID key. VersionIDProperty = "versionId" // CanonicalIDProperty is canonical ID key. CanonicalIDProperty = "canonicalId" // EquivalentIDProperty is equivalent ID array. EquivalentIDProperty = "equivalentId" // MethodProperty is used for method metadata within did document metadata. MethodProperty = "method" // UnpublishedOperationsProperty holds unpublished did operations. UnpublishedOperationsProperty = "unpublishedOperations" // PublishedOperationsProperty holds published did operations. PublishedOperationsProperty = "publishedOperations" )
const IDProperty = "id"
IDProperty describes id key.
const ServiceEndpointProperty = "serviceEndpoint"
ServiceEndpointProperty describes external service endpoint property.
Variables ¶
This section is empty.
Functions ¶
func StringArray ¶ added in v0.1.3
func StringArray(entry interface{}) []string
StringArray is utility function to return string array from interface.
Types ¶
type DIDDocument ¶
type DIDDocument map[string]interface{}
DIDDocument Defines DID Document data structure used by Sidetree for basic type safety checks.
func DIDDocumentFromReader ¶
func DIDDocumentFromReader(r io.Reader) (DIDDocument, error)
DIDDocumentFromReader creates an instance of DIDDocument by reading a JSON document from Reader.
func DidDocumentFromBytes ¶
func DidDocumentFromBytes(data []byte) (DIDDocument, error)
DidDocumentFromBytes creates an instance of DIDDocument by reading a JSON document from bytes.
func DidDocumentFromJSONLDObject ¶ added in v0.1.3
func DidDocumentFromJSONLDObject(jsonldObject map[string]interface{}) DIDDocument
DidDocumentFromJSONLDObject creates an instance of DIDDocument from json ld object.
func (DIDDocument) AgreementKeys ¶ added in v0.1.5
func (doc DIDDocument) AgreementKeys() []interface{}
AgreementKeys returns agreement method array (mixture of strings and objects).
func (DIDDocument) AlsoKnownAs ¶ added in v1.0.0
func (doc DIDDocument) AlsoKnownAs() []string
AlsoKnownAs are alternate identifiers for DID subject.
func (DIDDocument) AssertionMethods ¶ added in v0.1.5
func (doc DIDDocument) AssertionMethods() []interface{}
AssertionMethods returns assertion method array (mixture of strings and objects).
func (DIDDocument) Authentications ¶ added in v0.1.5
func (doc DIDDocument) Authentications() []interface{}
Authentications returns authentication array (mixture of strings and objects).
func (DIDDocument) Context ¶
func (doc DIDDocument) Context() []interface{}
Context is the context of did document.
func (DIDDocument) DelegationKeys ¶ added in v0.1.5
func (doc DIDDocument) DelegationKeys() []interface{}
DelegationKeys returns delegation method array (mixture of strings and objects).
func (DIDDocument) ID ¶
func (doc DIDDocument) ID() string
ID is identifier for DID subject (what DID Document is about).
func (DIDDocument) InvocationKeys ¶ added in v0.1.5
func (doc DIDDocument) InvocationKeys() []interface{}
InvocationKeys returns invocation method array (mixture of strings and objects).
func (DIDDocument) JSONLdObject ¶
func (doc DIDDocument) JSONLdObject() map[string]interface{}
JSONLdObject returns map that represents JSON LD Object.
func (DIDDocument) PublicKeys ¶
func (doc DIDDocument) PublicKeys() []PublicKey
PublicKeys are used for digital signatures, encryption and other cryptographic operations.
func (DIDDocument) Services ¶
func (doc DIDDocument) Services() []Service
Services is an array of service endpoints.
func (DIDDocument) VerificationMethods ¶ added in v0.1.5
func (doc DIDDocument) VerificationMethods() []PublicKey
VerificationMethods (formerly public keys) are used for digital signatures, encryption and other cryptographic operations.
type Document ¶
type Document map[string]interface{}
Document defines generic document data structure.
func FromJSONLDObject ¶ added in v0.1.3
FromJSONLDObject creates an instance of Document from json ld object.
func (Document) Context ¶ added in v0.7.0
func (doc Document) Context() []interface{}
Context is the context of document.
func (Document) GetStringValue ¶
GetStringValue returns string value for specified key or "" if not found or wrong type.
func (Document) JSONLdObject ¶
JSONLdObject returns map that represents JSON LD Object.
func (Document) PublicKeys ¶ added in v0.1.3
PublicKeys in generic document are used for managing operation keys.
type JWK ¶ added in v0.1.3
type JWK map[string]interface{}
JWK represents public key in JWK format.
type Metadata ¶ added in v0.1.5
type Metadata map[string]interface{}
Metadata can contains various metadata such as document metadata and method metadata..
type PublicKey ¶
type PublicKey map[string]interface{}
PublicKey must include id and type properties, and exactly one value property.
func NewPublicKey ¶
NewPublicKey creates new public key.
func ParsePublicKeys ¶ added in v0.1.3
func ParsePublicKeys(entry interface{}) []PublicKey
ParsePublicKeys is helper function for parsing public keys.
func (PublicKey) Controller ¶
Controller identifies the entity that controls the corresponding private key.
func (PublicKey) JSONLdObject ¶ added in v0.1.3
JSONLdObject returns map that represents JSON LD Object.
func (PublicKey) PublicKeyBase58 ¶
PublicKeyBase58 is base58 encoded public key.
func (PublicKey) PublicKeyJwk ¶ added in v0.1.3
PublicKeyJwk is value property for JWK.
func (PublicKey) PublicKeyMultibase ¶ added in v1.0.0
PublicKeyMultibase is multibase public key.
type ReplaceDocument ¶ added in v0.1.4
type ReplaceDocument map[string]interface{}
ReplaceDocument defines replace document data structure.
func ReplaceDocumentFromBytes ¶ added in v0.1.4
func ReplaceDocumentFromBytes(data []byte) (ReplaceDocument, error)
ReplaceDocumentFromBytes creates an instance of replace document (for 'replace' patch, may be used for replace action).
func ReplaceDocumentFromJSONLDObject ¶ added in v0.1.4
func ReplaceDocumentFromJSONLDObject(jsonldObject map[string]interface{}) ReplaceDocument
ReplaceDocumentFromJSONLDObject creates an instance of ReplaceDocument from json ld object.
func (ReplaceDocument) JSONLdObject ¶ added in v0.1.4
func (doc ReplaceDocument) JSONLdObject() map[string]interface{}
JSONLdObject returns map that represents JSON LD Object.
func (ReplaceDocument) PublicKeys ¶ added in v0.1.4
func (doc ReplaceDocument) PublicKeys() []PublicKey
PublicKeys returns public keys for replace document.
func (ReplaceDocument) Services ¶ added in v0.1.4
func (doc ReplaceDocument) Services() []Service
Services returns services for replace document.
type ResolutionOption ¶ added in v1.0.0
type ResolutionOption func(opts *ResolutionOptions)
ResolutionOption is an option for specifying the resolution options for various resolvers.
func WithAdditionalOperations ¶ added in v1.0.0
func WithAdditionalOperations(additionalOperations []*operation.AnchoredOperation) ResolutionOption
WithAdditionalOperations sets the additional operations to be used in a Resolve call.
func WithVersionID ¶ added in v1.0.0
func WithVersionID(versionID string) ResolutionOption
WithVersionID sets the version ID to be used in a Resolve call.
func WithVersionTime ¶ added in v1.0.0
func WithVersionTime(versionTime string) ResolutionOption
WithVersionTime sets the version time to be used in a Resolve call.
type ResolutionOptions ¶ added in v1.0.0
type ResolutionOptions struct { AdditionalOperations []*operation.AnchoredOperation VersionID string VersionTime string }
ResolutionOptions represent resolution options.
func GetResolutionOptions ¶ added in v1.0.0
func GetResolutionOptions(opts ...ResolutionOption) (ResolutionOptions, error)
GetResolutionOptions returns resolution options.
type ResolutionResult ¶ added in v0.1.3
type ResolutionResult struct { Context interface{} `json:"@context"` Document Document `json:"didDocument"` DocumentMetadata Metadata `json:"didDocumentMetadata,omitempty"` }
ResolutionResult describes resolution result.
type Service ¶
type Service map[string]interface{}
Service represents any type of service the entity wishes to advertise.
func ParseServices ¶ added in v0.1.3
func ParseServices(entry interface{}) []Service
ParseServices is utility for parsing array of service endpoints.
func (Service) JSONLdObject ¶ added in v0.1.3
JSONLdObject returns map that represents JSON LD Object.
func (Service) ServiceEndpoint ¶ added in v0.1.4
func (s Service) ServiceEndpoint() interface{}
ServiceEndpoint is service endpoint.