did

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// PublicKeyEncodingJwk define jwk encoding type
	PublicKeyEncodingJwk = "Jwk"

	// KeyUsageOps defines key usage as operations key
	KeyUsageOps = "ops"
	// KeyUsageAuth defines key usage as authentication key
	KeyUsageAuth = "auth"
	// KeyUsageAssertion defines key usage as assertion key
	KeyUsageAssertion = "assertion"
	// KeyUsageDelegation defines key usage as delegation key
	KeyUsageDelegation = "delegation"
	// KeyUsageInvocation defines key usage as invocation key
	KeyUsageInvocation = "invocation"
	// KeyUsageGeneral defines key usage as general key
	KeyUsageGeneral = "general"

	// JWSVerificationKey2020 defines key type signature
	JWSVerificationKey2020 = "JwsVerificationKey2020"

	// Ed25519VerificationKey2018 define key type signature
	Ed25519VerificationKey2018 = "Ed25519VerificationKey2018"

	// Ed25519KeyType defines ed25119 key type
	Ed25519KeyType = "Ed25519"

	// P256KeyType EC P-256 key type
	P256KeyType = "P256"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client for did bloc

func New

func New(opts ...Option) *Client

New return did bloc client

func (*Client) CreateDID

func (c *Client) CreateDID(domain string, opts ...CreateDIDOption) (*docdid.Doc, error)

CreateDID create did doc

type CreateDIDOption

type CreateDIDOption func(opts *CreateDIDOpts)

CreateDIDOption is a create DID option

func WithPublicKey

func WithPublicKey(publicKey *PublicKey) CreateDIDOption

WithPublicKey add DID public key

func WithService

func WithService(service *docdid.Service) CreateDIDOption

WithService add service

type CreateDIDOpts

type CreateDIDOpts struct {
	// contains filtered or unexported fields
}

CreateDIDOpts create did opts

type Doc

type Doc struct {
	PublicKey []PublicKey
	Service   []docdid.Service
}

Doc DID Document definition

func (*Doc) JSONBytes

func (doc *Doc) JSONBytes() ([]byte, error)

JSONBytes converts document to json bytes

type Option

type Option func(opts *Client)

Option is a DID client instance option

func WithAuthToken

func WithAuthToken(authToken string) Option

WithAuthToken add auth token

func WithTLSConfig

func WithTLSConfig(tlsConfig *tls.Config) Option

WithTLSConfig option is for definition of secured HTTP transport using a tls.Config instance

type PublicKey

type PublicKey struct {
	ID       string
	Type     string
	Encoding string
	KeyType  string
	Usage    []string
	Recovery bool

	Value []byte
}

PublicKey DID doc public key.

Jump to

Keyboard shortcuts

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