doc

package
v0.1.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (

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

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

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

func PopulateRawPublicKeys

func PopulateRawPublicKeys(pks []PublicKey) ([]map[string]interface{}, error)

PopulateRawPublicKeys populate raw public keys

func PopulateRawServices

func PopulateRawServices(services []docdid.Service) []map[string]interface{}

PopulateRawServices populate raw services

Types

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 PublicKey

type PublicKey struct {
	ID       string
	Type     string
	Encoding string
	KeyType  string
	Purposes []string

	Value []byte
}

PublicKey DID doc public key.

func (*PublicKey) GetValueFromJWK

func (pk *PublicKey) GetValueFromJWK(jwk *jose.JSONWebKey) error

GetValueFromJWK Populate the PublicKey contents from a JSON Web Key

Jump to

Keyboard shortcuts

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