client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreateRequest

func NewCreateRequest(info *CreateRequestInfo) ([]byte, error)

NewCreateRequest is utility function to create payload for 'create' request.

func NewDeactivateRequest

func NewDeactivateRequest(info *DeactivateRequestInfo) ([]byte, error)

NewDeactivateRequest is utility function to create payload for 'deactivate' request.

func NewRecoverRequest

func NewRecoverRequest(info *RecoverRequestInfo) ([]byte, error)

NewRecoverRequest is utility function to create payload for 'recovery' request.

func NewUpdateRequest

func NewUpdateRequest(info *UpdateRequestInfo) ([]byte, error)

NewUpdateRequest is utility function to create payload for 'update' request.

Types

type CreateRequestInfo

type CreateRequestInfo struct {

	// opaque document content
	// required
	OpaqueDocument string

	// patches that will be used to create document
	// required if opaque document is not specified
	Patches []patch.Patch

	// the recovery commitment
	// required
	RecoveryCommitment string

	// the update commitment
	// required
	UpdateCommitment string

	// AnchorOrigin signifies the system(s) that know the most recent anchor for this DID (optional)
	AnchorOrigin interface{}

	// Type signifies the type of entity a DID represents (optional)
	Type string

	// latest hashing algorithm supported by protocol
	MultihashCode uint
}

CreateRequestInfo contains data for creating create payload.

type DeactivateRequestInfo

type DeactivateRequestInfo struct {

	// DidSuffix is the suffix of the document to be deactivated
	DidSuffix string

	// RecoveryKey is recovery key for current deactivate request
	RecoveryKey *jws.JWK

	// Signer that will be used for signing specific subset of request data
	// Signer for recover operation must be recovery key
	Signer Signer

	// RevealValue is reveal value
	RevealValue string

	// AnchorFrom defines earliest time for this operation.
	AnchorFrom int64

	// AnchorUntil defines expiry time for this operation.
	AnchorUntil int64
}

DeactivateRequestInfo is the information required to create deactivate request.

type RecoverRequestInfo

type RecoverRequestInfo struct {

	// DidSuffix is the suffix of the document to be recovered
	DidSuffix string

	// RecoveryKey is the current recovery public key
	RecoveryKey *jws.JWK

	// OpaqueDocument is opaque content
	OpaqueDocument string

	// Patches that will be used to create document
	// required if opaque document is not specified
	Patches []patch.Patch

	// RecoveryCommitment is recovery commitment to be used for the next recovery
	RecoveryCommitment string

	// UpdateCommitment is update commitment to be used for the next update
	UpdateCommitment string

	// AnchorOrigin signifies the system(s) that know the most recent anchor for this DID (optional)
	AnchorOrigin interface{}

	// AnchorFrom defines earliest time for this operation.
	AnchorFrom int64

	// AnchorUntil defines expiry time for this operation.
	AnchorUntil int64

	// MultihashCode is the latest hashing algorithm supported by protocol
	MultihashCode uint

	// Signer will be used for signing specific subset of request data
	// Signer for recover operation must be recovery key
	Signer Signer

	// RevealValue is reveal value
	RevealValue string
}

RecoverRequestInfo is the information required to create recover request.

type Signer

type Signer interface {
	// Sign signs data and returns signature value
	Sign(data []byte) ([]byte, error)

	// Headers provides required JWS protected headers. It provides information about signing key and algorithm.
	Headers() jws.Headers
}

Signer defines JWS Signer interface that will be used to sign required data in Sidetree request.

type UpdateRequestInfo

type UpdateRequestInfo struct {

	// DidSuffix is the suffix of the document to be updated
	DidSuffix string

	// Patches is an array of standard patch actions
	Patches []patch.Patch

	// update commitment to be used for the next update
	UpdateCommitment string

	// update key to be used for this update
	UpdateKey *jws.JWK

	// latest hashing algorithm supported by protocol
	MultihashCode uint

	// Signer that will be used for signing request specific subset of data
	Signer Signer

	// RevealValue is reveal value
	RevealValue string

	// AnchorFrom defines earliest time for this operation.
	AnchorFrom int64

	// AnchorUntil defines expiry time for this operation.
	AnchorUntil int64
}

UpdateRequestInfo is the information required to create update request.

Jump to

Keyboard shortcuts

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