common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 8 Imported by: 7

Documentation

Overview

Package common implements common functionality like jwt sign and did public key resolve.

Index

Constants

View Source
const (
	// Ed25519VerificationKey2018 is a supported DID verification type.
	Ed25519VerificationKey2018 = "Ed25519VerificationKey2018"
	// JSONWebKey2020 is a supported DID verification type.
	JSONWebKey2020 = "JsonWebKey2020"
	// EdDSA is  signature algorithm for Ed25519VerificationKey2018.
	EdDSA = "EdDSA"
)

Variables

This section is empty.

Functions

func DefaultHTTPClient

func DefaultHTTPClient() *http.Client

DefaultHTTPClient creates an http.Client with default parameters.

Types

type JWSSigner

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

JWSSigner utility class used to sign jwt using api.Crypto.

func NewJWSSigner

func NewJWSSigner(vm *models.VerificationMethod, crypto api.Crypto) (*JWSSigner, error)

NewJWSSigner creates jwt signer.

func (*JWSSigner) GetKeyID

func (s *JWSSigner) GetKeyID() string

GetKeyID return id of key used for signing.

func (*JWSSigner) Headers

func (s *JWSSigner) Headers() jose.Headers

Headers provides JWS headers.

func (*JWSSigner) Sign

func (s *JWSSigner) Sign(data []byte) ([]byte, error)

Sign signs jwt token.

type VDRKeyResolver

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

VDRKeyResolver resolves DID in order to find public keys for VC verification using vdr.Registry. A source of DID could be issuer of VC or holder of VP. It can be also obtained from JWS "issuer" claim or "verificationMethod" of Linked Data Proof.

func NewVDRKeyResolver

func NewVDRKeyResolver(resolver api.DIDResolver) *VDRKeyResolver

NewVDRKeyResolver creates VDRKeyResolver.

func (*VDRKeyResolver) PublicKeyFetcher

func (r *VDRKeyResolver) PublicKeyFetcher() verifiable.PublicKeyFetcher

PublicKeyFetcher returns Public Key Fetcher via DID resolution mechanism.

Jump to

Keyboard shortcuts

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