resolver

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DIDDocResolver

type DIDDocResolver struct {
	VDRRegistry vdrapi.Registry
}

DIDDocResolver helps resolves a KMS kid from 'kid'/'skid' with values set as didDoc[].KeyAgreement[].ID. The list of DIDDocs should contain both sender and recipients docs for proper resolutio during unpacking.

func (*DIDDocResolver) Resolve

func (d *DIDDocResolver) Resolve(kid string) (*cryptoapi.PublicKey, error)

Resolve kid into a *cryptoapi.PublicKey with ID set as the KMS kid. Where kid matches the DID doc found in the vdr registry with first key entry matching doc.keyAgreement[].VerificationMethod.ID.

type DIDKeyResolver

type DIDKeyResolver struct{}

DIDKeyResolver resolves a 'kid'/'skid' containing a did:key value.

func (*DIDKeyResolver) Resolve

func (k *DIDKeyResolver) Resolve(kid string) (*cryptoapi.PublicKey, error)

Resolve a 'kid'/'skid' protected header with a did:key value into a marshalled public key or error if key resolution fails.

type KIDResolver

type KIDResolver interface {
	// Resolve a 'kid'/'skid' into a marshalled public key or error if key resolution fails.
	Resolve(string) (*cryptoapi.PublicKey, error)
}

KIDResolver helps resolve the kid public key from a recipient 'kid' or a sender 'skid' during JWE decryption. The JWEDecrypter should be able to load the public key using a resolution scheme for a key reference found in the 'skid' JWE protected header/'kid' recipient header.

type StoreResolver

type StoreResolver struct {
	// store where the kid key is potentially stored.
	Store storage.Store
}

StoreResolver resolves a 'kid'/'skid' containing a kms ID value (JWK fingerprint) from a dedicated pre-loaded store. Note: this is not a kms keystore. This StoreResolver is useful in cases where a thirdparty store is needed. This is useful in unit tests and especially for test vectors using the ECDH-1PU Appendix B example to load the sender key so that recipients can resolve a predefined 'skid'. Aries Framework Go is using the DIDKeyResolver by default (for request without DID docs) and DIDDocResolver (for requests with existing DID connections).

func (*StoreResolver) Resolve

func (s *StoreResolver) Resolve(kid string) (*cryptoapi.PublicKey, error)

Resolve a 'kid'/'skid' by loading kid's PublicKey from a store or return an error if it fails.

Jump to

Keyboard shortcuts

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