func (s *StoreResolver) Resolve(kid string) (*cryptoapi.PublicKey, error) {
	var pubKey *cryptoapi.PublicKey
	mPubKey, err := s.Store.Get(kid)
	if err != nil {
		return nil, fmt.Errorf("storeResolver: failed to resolve kid from store: %w", err)
	}
	err = json.Unmarshal(mPubKey, &pubKey)
	if err != nil {
		return nil, fmt.Errorf("storeResolver: failed to unmarshal public key from DB: %w", err)
	}
	return pubKey, nil
}
Resolve a 'kid'/'skid' by loading kid's PublicKey from a store or return an error if it fails.
package resolver
import (
	"crypto/ecdsa"
	"crypto/elliptic"
	"encoding/json"
	"errors"
	"fmt"
	"strings"
	cryptoapi "github.com/hyperledger/aries-framework-go/pkg/crypto"
	"github.com/hyperledger/aries-framework-go/pkg/doc/did"
	"github.com/hyperledger/aries-framework-go/pkg/doc/util/jwkkid"
	"github.com/hyperledger/aries-framework-go/pkg/doc/util/kmsdidkey"
	vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr"
	"github.com/hyperledger/aries-framework-go/pkg/kms"
	"github.com/hyperledger/aries-framework-go/spi/storage"
)
const (
	jsonWebKey2020            = "JsonWebKey2020"
	x25519KeyAgreementKey2019 = "X25519KeyAgreementKey2019"
)
type KIDResolver interface {
	Resolve(string) (*cryptoapi.PublicKey, error)
}
type DIDKeyResolver struct{}
func (k *DIDKeyResolver) Resolve(kid string) (*cryptoapi.PublicKey, error) {
	return kmsdidkey.EncryptionPubKeyFromDIDKey(kid)
}
type StoreResolver struct {
	Store storage.Store
}