diff --git a/vcr/issuer/issuer.go b/vcr/issuer/issuer.go index 41861bf711..ea40c5bf6d 100644 --- a/vcr/issuer/issuer.go +++ b/vcr/issuer/issuer.go @@ -93,6 +93,11 @@ type issuer struct { // If publish is true, it publishes the credential to the network using the configured Publisher // Use the public flag to pass the visibility settings to the Publisher. func (i issuer) Issue(ctx context.Context, template vc.VerifiableCredential, options CredentialOptions) (*vc.VerifiableCredential, error) { + // Until further notice we don't support publishing JWT VCs, since they're not officially supported by Nuts yet. + if options.Publish && options.Format == JWTCredentialFormat { + return nil, errors.New("publishing VC JWTs is not supported") + } + createdVC, err := i.buildVC(ctx, template, options) if err != nil { return nil, err diff --git a/vcr/issuer/issuer_test.go b/vcr/issuer/issuer_test.go index f403cbc866..d978de26c7 100644 --- a/vcr/issuer/issuer_test.go +++ b/vcr/issuer/issuer_test.go @@ -284,6 +284,18 @@ func Test_issuer_Issue(t *testing.T) { assert.True(t, trustConfig.IsTrusted(credentialType, result.Issuer)) }) + t.Run("publishing JWT VCs is disallowed", func(t *testing.T) { + sut := issuer{} + + result, err := sut.Issue(ctx, template, CredentialOptions{ + Publish: true, + Public: true, + Format: JWTCredentialFormat, + }) + require.EqualError(t, err, "publishing VC JWTs is not supported") + assert.Nil(t, result) + }) + t.Run("OpenID4VCI", func(t *testing.T) { const walletIdentifier = "http://example.com/wallet" t.Run("ok - publish over OpenID4VCI fails - fallback to network", func(t *testing.T) {