Skip to content

Commit

Permalink
w
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Sep 26, 2023
1 parent 061bff2 commit 91911f9
Show file tree
Hide file tree
Showing 44 changed files with 538 additions and 709 deletions.
6 changes: 3 additions & 3 deletions auth/api/iam/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/nuts-foundation/nuts-node/core"
"github.com/nuts-foundation/nuts-node/vcr"
"github.com/nuts-foundation/nuts-node/vcr/openid4vci"
"github.com/nuts-foundation/nuts-node/vdr/didservice"
"github.com/nuts-foundation/nuts-node/vdr/resolver"
vdr "github.com/nuts-foundation/nuts-node/vdr/types"
"html/template"
"net/http"
Expand Down Expand Up @@ -206,7 +206,7 @@ func (r Wrapper) OAuthAuthorizationServerMetadata(ctx context.Context, request O

owned, err := r.vdr.IsOwner(ctx, ownDID)
if err != nil {
if didservice.IsFunctionalResolveError(err) {
if resolver.IsFunctionalResolveError(err) {
return nil, core.NotFoundError("authz server metadata: %w", err)
}
log.Logger().WithField("did", ownDID.String()).Errorf("authz server metadata: failed to assert ownership of did: %s", err.Error())
Expand All @@ -227,7 +227,7 @@ func (r Wrapper) GetWebDID(ctx context.Context, request GetWebDIDRequestObject)

document, err := r.vdr.DeriveWebDIDDocument(ctx, baseURL, ownDID)
if err != nil {
if didservice.IsFunctionalResolveError(err) {
if resolver.IsFunctionalResolveError(err) {
return GetWebDID404Response{}, nil
}
log.Logger().WithError(err).Errorf("Could not resolve Nuts DID: %s", ownDID.String())
Expand Down
5 changes: 2 additions & 3 deletions crypto/api/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"github.com/nuts-foundation/nuts-node/audit"
"github.com/nuts-foundation/nuts-node/core"
"github.com/nuts-foundation/nuts-node/crypto"
"github.com/nuts-foundation/nuts-node/vdr/types"
)

var _ StrictServerInterface = (*Wrapper)(nil)
Expand Down Expand Up @@ -196,14 +195,14 @@ func (w *Wrapper) resolvePublicKey(id *did.DID) (key crypt.PublicKey, keyID ssi.
if id.IsURL() {
// Assume it is a keyId
now := time.Now()
key, err = w.K.ResolveKeyByID(id.String(), &now, types.KeyAgreement)
key, err = w.K.ResolveKeyByID(id.String(), &now, resolver.KeyAgreement)
if err != nil {
return nil, ssi.URI{}, err
}
keyID = id.URI()
} else {
// Assume it is a DID
keyID, key, err = w.K.ResolveKey(*id, nil, types.KeyAgreement)
keyID, key, err = w.K.ResolveKey(*id, nil, resolver.KeyAgreement)
if err != nil {
return nil, ssi.URI{}, err
}
Expand Down
22 changes: 11 additions & 11 deletions crypto/api/v1/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func TestWrapper_EncryptJwe(t *testing.T) {
Payload: payload,
Headers: headers,
}
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, types.KeyAgreement).Return(ssi.URI{}, nil, errors.New("FAIL"))
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, resolver.KeyAgreement).Return(ssi.URI{}, nil, errors.New("FAIL"))

jwe, err := ctx.client.EncryptJwe(nil, EncryptJweRequestObject{Body: &request})
assert.EqualError(t, err, "invalid receiver: FAIL")
Expand All @@ -268,7 +268,7 @@ func TestWrapper_EncryptJwe(t *testing.T) {
Payload: payload,
Headers: headers,
}
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, types.KeyAgreement).Return(ssi.URI{}, nil, errors.New("FAIL"))
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, resolver.KeyAgreement).Return(ssi.URI{}, nil, errors.New("FAIL"))

jwe, err := ctx.client.EncryptJwe(nil, EncryptJweRequestObject{Body: &request})
assert.EqualError(t, err, "invalid receiver: FAIL")
Expand All @@ -283,7 +283,7 @@ func TestWrapper_EncryptJwe(t *testing.T) {
Payload: payload,
Headers: headers,
}
ctx.keyResolver.EXPECT().ResolveKeyByID(gomock.Any(), gomock.Any(), types.KeyAgreement).Return(ssi.URI{}, errors.New("FAIL"))
ctx.keyResolver.EXPECT().ResolveKeyByID(gomock.Any(), gomock.Any(), resolver.KeyAgreement).Return(ssi.URI{}, errors.New("FAIL"))

jwe, err := ctx.client.EncryptJwe(nil, EncryptJweRequestObject{Body: &request})
assert.EqualError(t, err, "invalid receiver: FAIL")
Expand All @@ -298,7 +298,7 @@ func TestWrapper_EncryptJwe(t *testing.T) {
Payload: payload,
Headers: headers,
}
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, types.KeyAgreement).Return(ssi.URI{}, nil, resolver.ErrNotFound)
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, resolver.KeyAgreement).Return(ssi.URI{}, nil, resolver.ErrNotFound)

jwe, err := ctx.client.EncryptJwe(nil, EncryptJweRequestObject{Body: &request})
assert.EqualError(t, err, "unable to locate receiver did:nuts:12345: unable to find the DID document")
Expand All @@ -313,7 +313,7 @@ func TestWrapper_EncryptJwe(t *testing.T) {
Payload: payload,
Headers: headers,
}
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, types.KeyAgreement).Return(ssi.URI{}, nil, resolver.ErrNotFound)
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, resolver.KeyAgreement).Return(ssi.URI{}, nil, resolver.ErrNotFound)

jwe, err := ctx.client.EncryptJwe(nil, EncryptJweRequestObject{Body: &request})
assert.EqualError(t, err, "unable to locate receiver did:nuts:12345: unable to find the DID document")
Expand All @@ -328,7 +328,7 @@ func TestWrapper_EncryptJwe(t *testing.T) {
Payload: payload,
Headers: headers,
}
ctx.keyResolver.EXPECT().ResolveKeyByID(gomock.Any(), gomock.Any(), types.KeyAgreement).Return(ssi.URI{}, resolver.ErrNotFound)
ctx.keyResolver.EXPECT().ResolveKeyByID(gomock.Any(), gomock.Any(), resolver.KeyAgreement).Return(ssi.URI{}, resolver.ErrNotFound)

jwe, err := ctx.client.EncryptJwe(nil, EncryptJweRequestObject{Body: &request})
assert.EqualError(t, err, "unable to locate receiver did:nuts:12345#key-1: unable to find the DID document")
Expand Down Expand Up @@ -360,7 +360,7 @@ func TestWrapper_EncryptJwe(t *testing.T) {
did, _ := ssi.ParseURI("did:nuts:12345")
ctx.keyStore.EXPECT().EncryptJWE(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return("", errors.New("b00m!"))

ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, types.KeyAgreement).Return(*did, nil, nil)
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, resolver.KeyAgreement).Return(*did, nil, nil)

jwe, err := ctx.client.EncryptJwe(audit.TestContext(), EncryptJweRequestObject{Body: &request})

Expand All @@ -378,7 +378,7 @@ func TestWrapper_EncryptJwe(t *testing.T) {
Payload: payload,
}
ctx.keyStore.EXPECT().EncryptJWE(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return("jwe", nil)
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, types.KeyAgreement).Return(*did, nil, nil)
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, resolver.KeyAgreement).Return(*did, nil, nil)

resp, err := ctx.client.EncryptJwe(nil, EncryptJweRequestObject{Body: &request})

Expand All @@ -396,7 +396,7 @@ func TestWrapper_EncryptJwe(t *testing.T) {
Payload: payload,
}
ctx.keyStore.EXPECT().EncryptJWE(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return("jwe", nil)
ctx.keyResolver.EXPECT().ResolveKeyByID(gomock.Any(), gomock.Any(), types.KeyAgreement).Return(*did, nil)
ctx.keyResolver.EXPECT().ResolveKeyByID(gomock.Any(), gomock.Any(), resolver.KeyAgreement).Return(*did, nil)

resp, err := ctx.client.EncryptJwe(nil, EncryptJweRequestObject{Body: &request})

Expand All @@ -414,7 +414,7 @@ func TestWrapper_EncryptJwe(t *testing.T) {
}
did, _ := ssi.ParseURI(kid)
ctx.keyStore.EXPECT().EncryptJWE(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return("jwe", nil)
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, types.KeyAgreement).Return(*did, nil, nil)
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, resolver.KeyAgreement).Return(*did, nil, nil)

resp, err := ctx.client.EncryptJwe(nil, EncryptJweRequestObject{Body: &request})

Expand All @@ -430,7 +430,7 @@ func TestWrapper_EncryptJwe(t *testing.T) {
Receiver: did.String(),
}
ctx.keyStore.EXPECT().EncryptJWE(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return("jwe", nil)
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, types.KeyAgreement).Return(*did, nil, nil)
ctx.keyResolver.EXPECT().ResolveKey(gomock.Any(), nil, resolver.KeyAgreement).Return(*did, nil, nil)

resp, err := ctx.client.EncryptJwe(nil, EncryptJweRequestObject{Body: &request})

Expand Down
7 changes: 3 additions & 4 deletions didman/didman.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/nuts-foundation/nuts-node/vdr/didservice"
"github.com/nuts-foundation/nuts-node/vdr/resolver"
"net/url"
"sync"
Expand Down Expand Up @@ -283,7 +282,7 @@ func (d *didman) GetCompoundServiceEndpoint(id did.DID, compoundServiceType stri
}

func (d *didman) DeleteService(ctx context.Context, serviceID ssi.URI) error {
id, err := didservice.GetDIDFromURL(serviceID.String())
id, err := resolver.GetDIDFromURL(serviceID.String())
if err != nil {
return err
}
Expand All @@ -299,7 +298,7 @@ func (d *didman) deleteService(ctx context.Context, serviceID ssi.URI) error {
log.Logger().
WithField(core.LogFieldServiceID, serviceID.String()).
Debug("Deleting service")
id, err := didservice.GetDIDFromURL(serviceID.String())
id, err := resolver.GetDIDFromURL(serviceID.String())
if err != nil {
return err
}
Expand Down Expand Up @@ -469,7 +468,7 @@ func (d *didman) resolveOrganizationDIDDocuments(organizations []vc.VerifiableCr
j := 0
for i, organization := range organizations {
document, organizationDID, err := d.resolveOrganizationDIDDocument(organization)
if didservice.IsFunctionalResolveError(err) {
if resolver.IsFunctionalResolveError(err) {
// Just ignore deactivated DID documents or VCs that don't refer to an existing DID document.
// Log it on debug, because it might be useful for finding VCs that need to be revoked (since they're invalid).
log.Logger().
Expand Down
7 changes: 3 additions & 4 deletions golden_hammer/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"github.com/nuts-foundation/nuts-node/network/transport"
"github.com/nuts-foundation/nuts-node/vcr"
"github.com/nuts-foundation/nuts-node/vcr/openid4vci"
"github.com/nuts-foundation/nuts-node/vdr/didservice"
"github.com/nuts-foundation/nuts-node/vdr/resolver"
"github.com/nuts-foundation/nuts-node/vdr/types"
"net/url"
Expand Down Expand Up @@ -142,7 +141,7 @@ func (h *GoldenHammer) registerServiceBaseURLs() error {
serviceEndpoint := getServiceEndpoint(document, transport.NutsCommServiceType)
if resolver.IsServiceReference(serviceEndpoint) {
// Care organization DID document, register service pointing to vendor DID.
parentDID, err := didservice.GetDIDFromURL(serviceEndpoint)
parentDID, err := resolver.GetDIDFromURL(serviceEndpoint)
if err != nil {
// Invalid NutsComm reference, skip
log.Logger().WithError(err).
Expand Down Expand Up @@ -194,7 +193,7 @@ func (h *GoldenHammer) listDocumentToFix() ([]did.Document, error) {
}
document, _, err := h.vdrInstance.Resolver().Resolve(id, nil)
if err != nil {
if !didservice.IsFunctionalResolveError(err) {
if !resolver.IsFunctionalResolveError(err) {
log.Logger().WithError(err).Infof("Can't resolve DID document, skipping fix (did=%s)", id)
}
continue
Expand Down Expand Up @@ -238,7 +237,7 @@ func (h *GoldenHammer) tryResolveURL(id did.DID) (*url.URL, error) {
// resolveContainsService returns whether 1. given DID document can be resolved, and 2. it contains the specified service.
func (h *GoldenHammer) resolveContainsService(id did.DID, serviceType string) bool {
document, _, err := h.vdrInstance.Resolver().Resolve(id, nil)
if didservice.IsFunctionalResolveError(err) {
if resolver.IsFunctionalResolveError(err) {
// Unresolvable DID document, nothing to do
return false
}
Expand Down
3 changes: 1 addition & 2 deletions network/dag/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"fmt"
"github.com/nuts-foundation/go-did/did"
"github.com/nuts-foundation/nuts-node/crypto/hash"
"github.com/nuts-foundation/nuts-node/vdr/didservice"
resolver2 "github.com/nuts-foundation/nuts-node/vdr/resolver"
)

Expand Down Expand Up @@ -53,7 +52,7 @@ func resolvePublicKey(resolver resolver2.DIDResolver, kid string, metadata resol
if err != nil {
return nil, fmt.Errorf("invalid key ID (id=%s): %w", kid, err)
}
holder, _ := didservice.GetDIDFromURL(kid) // can't fail, already parsed
holder, _ := resolver2.GetDIDFromURL(kid) // can't fail, already parsed
doc, _, err := resolver.Resolve(holder, &metadata)
if err != nil {
return nil, err
Expand Down
3 changes: 1 addition & 2 deletions network/dag/pal.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"github.com/nuts-foundation/go-did/did"
"github.com/nuts-foundation/nuts-node/crypto"
"github.com/nuts-foundation/nuts-node/network/log"
"github.com/nuts-foundation/nuts-node/vdr/types"
)

// palHeaderDIDSeparator holds the character(s) that separate DID entries in the PAL header, before being encrypted.
Expand Down Expand Up @@ -59,7 +58,7 @@ func (pal PAL) Encrypt(keyResolver resolver.KeyResolver) (EncryptedPAL, error) {
var recipients [][]byte
for _, recipient := range pal {
recipients = append(recipients, []byte(recipient.String()))
_, rawKak, err := keyResolver.ResolveKey(recipient, nil, types.KeyAgreement)
_, rawKak, err := keyResolver.ResolveKey(recipient, nil, resolver.KeyAgreement)
if err != nil {
return nil, fmt.Errorf("unable to resolve keyAgreement key (recipient=%s): %w", recipient, err)
}
Expand Down
8 changes: 4 additions & 4 deletions network/dag/pal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func TestEncryptPal(t *testing.T) {
// Encrypt
ctrl := gomock.NewController(t)
keyResolver := types.NewMockKeyResolver(ctrl)
keyResolver.EXPECT().ResolveKey(*pA, nil, types.KeyAgreement).Return(ssi.URI{}, pkA.Public(), nil)
keyResolver.EXPECT().ResolveKey(*pB, nil, types.KeyAgreement).Return(ssi.URI{}, pkB.Public(), nil)
keyResolver.EXPECT().ResolveKey(*pA, nil, resolver.KeyAgreement).Return(ssi.URI{}, pkA.Public(), nil)
keyResolver.EXPECT().ResolveKey(*pB, nil, resolver.KeyAgreement).Return(ssi.URI{}, pkB.Public(), nil)
expected := PAL{*pA, *pB}
pal, err := expected.Encrypt(keyResolver)
require.NoError(t, err)
Expand All @@ -72,15 +72,15 @@ func TestEncryptPal(t *testing.T) {
t.Run("error - keyAgreement key type is not supported", func(t *testing.T) {
ctrl := gomock.NewController(t)
keyResolver := types.NewMockKeyResolver(ctrl)
keyResolver.EXPECT().ResolveKey(*pA, nil, types.KeyAgreement).Return(ssi.URI{}, &rsa.PublicKey{}, nil)
keyResolver.EXPECT().ResolveKey(*pA, nil, resolver.KeyAgreement).Return(ssi.URI{}, &rsa.PublicKey{}, nil)
pal, err := PAL{*pA}.Encrypt(keyResolver)
assert.Nil(t, pal)
assert.EqualError(t, err, "resolved keyAgreement key is not an elliptic curve key (recipient=did:nuts:A)")
})
t.Run("error - no keyAgreements", func(t *testing.T) {
ctrl := gomock.NewController(t)
keyResolver := types.NewMockKeyResolver(ctrl)
keyResolver.EXPECT().ResolveKey(*pA, nil, types.KeyAgreement).Return(ssi.URI{}, nil, resolver.ErrKeyNotFound)
keyResolver.EXPECT().ResolveKey(*pA, nil, resolver.KeyAgreement).Return(ssi.URI{}, nil, resolver.ErrKeyNotFound)
pal, err := PAL{*pA}.Encrypt(keyResolver)
assert.Nil(t, pal)
assert.EqualError(t, err, "unable to resolve keyAgreement key (recipient=did:nuts:A): key not found in DID document")
Expand Down
7 changes: 3 additions & 4 deletions network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"errors"
"fmt"
"github.com/nuts-foundation/nuts-node/vdr/didnuts/didstore"
"github.com/nuts-foundation/nuts-node/vdr/didservice"
"github.com/nuts-foundation/nuts-node/vdr/management"
"github.com/nuts-foundation/nuts-node/vdr/resolver"
"net"
"strings"
Expand All @@ -46,7 +46,6 @@ import (
"github.com/nuts-foundation/nuts-node/network/transport/v2"
"github.com/nuts-foundation/nuts-node/pki"
"github.com/nuts-foundation/nuts-node/storage"
"github.com/nuts-foundation/nuts-node/vdr/types"
"go.etcd.io/bbolt"
)

Expand Down Expand Up @@ -86,7 +85,7 @@ type Network struct {
peerID transport.PeerID
nodeDID did.DID
didStore didstore.Store
didDocumentFinder types.DocFinder
didDocumentFinder management.DocFinder
serviceResolver resolver.ServiceResolver
eventPublisher events.Event
storeProvider storage.Provider
Expand Down Expand Up @@ -391,7 +390,7 @@ func (n *Network) connectToKnownNodes(nodeDID did.DID) error {
}

// start connecting to published NutsComm addresses
otherNodes, err := n.didDocumentFinder.Find(didservice.IsActive(), didservice.ValidAt(time.Now()), didservice.ByServiceType(transport.NutsCommServiceType))
otherNodes, err := n.didDocumentFinder.Find(management.IsActive(), management.ValidAt(time.Now()), management.ByServiceType(transport.NutsCommServiceType))
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions network/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,8 @@ func TestNetwork_CreateTransaction(t *testing.T) {
cxt.state.EXPECT().Head(gomock.Any())
cxt.state.EXPECT().Add(gomock.Any(), gomock.Any(), payload)

cxt.keyResolver.EXPECT().ResolveKey(*sender, nil, vdrTypes.KeyAgreement).Return(ssi.MustParseURI("sender"), senderKey.Public(), nil)
cxt.keyResolver.EXPECT().ResolveKey(*receiver, nil, vdrTypes.KeyAgreement).Return(ssi.MustParseURI("receiver"), receiverKey.Public(), nil)
cxt.keyResolver.EXPECT().ResolveKey(*sender, nil, resolver.KeyAgreement).Return(ssi.MustParseURI("sender"), senderKey.Public(), nil)
cxt.keyResolver.EXPECT().ResolveKey(*receiver, nil, resolver.KeyAgreement).Return(ssi.MustParseURI("receiver"), receiverKey.Public(), nil)

_, err = cxt.network.CreateTransaction(ctx, TransactionTemplate(payloadType, payload, key).WithPrivate([]did.DID{*sender, *receiver}))
assert.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions vcr/credential/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"errors"
"fmt"
"github.com/nuts-foundation/go-did/did"
"github.com/nuts-foundation/nuts-node/vdr/didservice"
"github.com/nuts-foundation/nuts-node/vdr/resolver"
"github.com/piprate/json-gold/ld"
"strings"

Expand Down Expand Up @@ -238,7 +238,7 @@ func validOperation(operation string) bool {
}

func validateNutsCredentialID(credential vc.VerifiableCredential) error {
id, err := didservice.GetDIDFromURL(credential.ID.String())
id, err := resolver.GetDIDFromURL(credential.ID.String())
if err != nil {
return err
}
Expand Down
5 changes: 2 additions & 3 deletions vcr/issuer/issuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"encoding/json"
"fmt"
"github.com/nuts-foundation/nuts-node/vcr/openid4vci"
"github.com/nuts-foundation/nuts-node/vdr/didservice"
resolver2 "github.com/nuts-foundation/nuts-node/vdr/resolver"
"time"

Expand Down Expand Up @@ -194,7 +193,7 @@ func (i issuer) buildVC(ctx context.Context, credentialOptions vc.VerifiableCred
if err != nil {
const errString = "failed to sign credential: could not resolve an assertionKey for issuer: %w"
// Differentiate between a DID document not found and some other error:
if didservice.IsFunctionalResolveError(err) {
if resolver2.IsFunctionalResolveError(err) {
return nil, core.InvalidInputError(errString, err)
}
return nil, fmt.Errorf(errString, err)
Expand Down Expand Up @@ -298,7 +297,7 @@ func (i issuer) buildRevocation(ctx context.Context, credentialID ssi.URI) (*cre
if err != nil {
const errString = "failed to revoke credential (%s): could not resolve an assertionKey for issuer: %w"
// Differentiate between a DID document not found and some other error:
if didservice.IsFunctionalResolveError(err) {
if resolver2.IsFunctionalResolveError(err) {
return nil, core.InvalidInputError(errString, credentialID, err)
}
return nil, fmt.Errorf(errString, credentialID, err)
Expand Down
3 changes: 1 addition & 2 deletions vcr/issuer/keyresolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/nuts-foundation/go-did/did"
"github.com/nuts-foundation/nuts-node/crypto"
"github.com/nuts-foundation/nuts-node/vdr/resolver"
vdr "github.com/nuts-foundation/nuts-node/vdr/types"
)

// vdrKeyResolver resolves private keys based upon the VDR document resolver
Expand All @@ -35,7 +34,7 @@ type vdrKeyResolver struct {

// ResolveAssertionKey is a convenience method which tries to find a assertionKey on in the VDR for a given issuerDID.
func (r vdrKeyResolver) ResolveAssertionKey(ctx context.Context, issuerDID did.DID) (crypto.Key, error) {
kid, _, err := r.publicKeyResolver.ResolveKey(issuerDID, nil, vdr.AssertionMethod)
kid, _, err := r.publicKeyResolver.ResolveKey(issuerDID, nil, resolver.AssertionMethod)
if err != nil {
return nil, fmt.Errorf("invalid issuer: %w", err)
}
Expand Down
Loading

0 comments on commit 91911f9

Please sign in to comment.