helper

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

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

	// the recovery commitment
	// required
	RecoveryCommitment string

	// the update commitment
	// required
	UpdateCommitment string

	// latest hashing algorithm supported by protocol
	MultihashCode uint
}

CreateRequestInfo contains data for creating create payload

type DeactivateRequestInfo

type DeactivateRequestInfo struct {

	// DID Suffix of the document to be deactivated
	DidSuffix string

	// 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
}

DeactivateRequestInfo is the information required to create deactivate request

type RecoverRequestInfo

type RecoverRequestInfo struct {

	// DID Suffix of the document to be recovered
	DidSuffix string

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

	// opaque content
	OpaqueDocument string

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

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

	// 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
}

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 {

	// DID Suffix of the document to be updated
	DidSuffix string

	// Patch is one of standard patch actions
	Patch 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
}

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