[java-idp-plugin-vci] 03/03: Work on credential configurations. Initial support for jwt_vc_json-ld format by adding parsing for credential_definition

Codeberg noreply at shibboleth.net
Tue Dec 30 14:26:51 UTC 2025


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch dev/W3CCred
in repository java-idp-plugin-vci.

View the commit online:
https://codeberg.org/Shibboleth/java-idp-plugin-vci/commit/ad9e7c69e20c12363b1c15d861dacde7f642cc5d

commit ad9e7c69e20c12363b1c15d861dacde7f642cc5d
Author: jlauros <janne.lauros at csc.fi>
AuthorDate: Tue Dec 30 16:26:28 2025 +0200

    Work on credential configurations. Initial support for jwt_vc_json-ld format by adding parsing for credential_definition
---
 .../credential/CredentialConfiguration.java        | 120 +++++-
 .../credential/CredentialConfigurations.java       |  11 +-
 .../openidvci/credential/CredentialDefinition.java | 118 ++++++
 .../credential/CredentialConfigurationTest.java    |  32 +-
 .../credential/CredentialConfigurationsTest.java   |   8 +-
 ...tionTest.java => CredentialDefinitionTest.java} |  25 +-
 .../CredentialConfiguration_jwt_vc_json-ld.json    |  77 ++++
 .../CredentialConfigurationsSupported.json         | 454 ++++++++++-----------
 .../credentials/CredentialDefinition.json          |  10 +
 9 files changed, 564 insertions(+), 291 deletions(-)

diff --git a/openid-vci-api/src/main/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfiguration.java b/openid-vci-api/src/main/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfiguration.java
index d883011..4ddad53 100644
--- a/openid-vci-api/src/main/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfiguration.java
+++ b/openid-vci-api/src/main/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfiguration.java
@@ -17,7 +17,6 @@
 package org.geant.shibboleth.plugin.openidvci.credential;
 
 import java.util.List;
-import java.util.Map;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -29,67 +28,154 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.nimbusds.oauth2.sdk.ParseException;
 
 /**
  * Credential configuration in {@link CredentialConfigurations}.
+ * 
+ * Credential configurations are defined in
+ * {@link https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#name-credential-issuer-metadata-p}
+ * as parameter credential_configurations_supported. Still only a partial
+ * implementation of the parameters.
  */
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class CredentialConfiguration {
 
+    /** Identifies the format of this Credential. */
     @Nonnull
     @JsonProperty("format")
     @JsonInclude(Include.NON_NULL)
     private final String format;
 
+    /**
+     * Identifies the scope value that this Credential Issuer supports for this
+     * particular Credential.
+     */
     @Nullable
     @JsonProperty("scope")
     @JsonInclude(Include.NON_ABSENT)
     private final String scope;
 
+    /**
+     * An array of algorithm identifiers that identify the algorithms that the
+     * Issuer uses to sign the issued Credential.
+     */
     @Nullable
     @JsonProperty("credential_signing_alg_values_supported")
     @JsonInclude(Include.NON_ABSENT)
     private final List<String> credentialSigningAlgValuesSupported;
 
+    /**
+     * An array of case sensitive strings that identify the representation of the
+     * cryptographic key material that the issued Credential is bound to.
+     */
     @Nullable
     @JsonProperty("cryptographic_binding_methods_supported")
     @JsonInclude(Include.NON_ABSENT)
     private final List<String> cryptographicBindingMethodsSupported;
 
+    /** Object containing the detailed description of the Credential type. */
+    @Nullable
+    @JsonProperty("credential_definition")
+    @JsonInclude(Include.NON_NULL)
+    private final CredentialDefinition credentialDefinition;
+
+    /**
+     * Constructor.
+     * 
+     * @param format                               Identifies the format of this
+     *                                             Credential
+     * @param scope                                Identifies the scope value that
+     *                                             this Credential Issuer supports
+     *                                             for this particular Credential
+     * @param credentialSigningAlgValuesSupported  An array of algorithm identifiers
+     *                                             that identify the algorithms that
+     *                                             the Issuer uses to sign the
+     *                                             issued Credential
+     * @param cryptographicBindingMethodsSupported An array of case sensitive
+     *                                             strings that identify the
+     *                                             representation of the
+     *                                             cryptographic key material that
+     *                                             the issued Credential is bound to
+     * @param credentialDefinition                 Object containing the detailed
+     *                                             description of the Credential
+     *                                             type
+     */
     @JsonCreator
     private CredentialConfiguration(@JsonProperty("format") @Nonnull String format,
             @JsonProperty("scope") @Nullable String scope,
             @JsonProperty("credential_signing_alg_values_supported") @Nullable List<String> credentialSigningAlgValuesSupported,
-            @JsonProperty("cryptographic_binding_methods_supported") @Nullable List<String> cryptographicBindingMethodsSupported) {
+            @JsonProperty("cryptographic_binding_methods_supported") @Nullable List<String> cryptographicBindingMethodsSupported,
+            @JsonProperty("credential_definition") @Nullable CredentialDefinition credentialDefinition) {
         assert format != null;
         this.format = format;
         this.scope = scope;
         this.credentialSigningAlgValuesSupported = credentialSigningAlgValuesSupported;
         this.cryptographicBindingMethodsSupported = cryptographicBindingMethodsSupported;
-
+        this.credentialDefinition = credentialDefinition;
+        // W3C family of credentials require credential definition
+        if (credentialDefinition == null
+                && ("jwt_vc_json-ld".equals(format) || "jwt_vc_json".equals(format) || "ldp_vc".equals(format))) {
+            throw new IllegalArgumentException("credential_definition is missing");
+        }
     }
 
+    /**
+     * Get format of this Credential.
+     * 
+     * @return Format of this Credential
+     */
     @Nonnull
     public String getFormat() {
         return format;
     }
 
+    /**
+     * Get scope value that this Credential Issuer supports for this particular
+     * Credential
+     * 
+     * @return Scope value that this Credential Issuer supports for this particular
+     *         Credential
+     */
     @Nullable
     public String getScope() {
         return scope;
     }
 
+    /**
+     * Get an array of algorithm identifiers that identify the algorithms that the
+     * Issuer uses to sign the issued Credential.
+     * 
+     * @return An array of algorithm identifiers that identify the algorithms that
+     *         the Issuer uses to sign the issued Credential
+     */
     @Nullable
     public List<String> getCredentialSigningAlgValuesSupported() {
         return credentialSigningAlgValuesSupported;
     }
 
+    /**
+     * Get an array of case sensitive strings that identify the representation of
+     * the cryptographic key material that the issued Credential is bound to.
+     * 
+     * @return An array of case sensitive strings that identify the representation
+     *         of the cryptographic key material that the issued Credential is bound
+     *         to
+     */
     @Nullable
     public List<String> getCryptographicBindingMethodsSupported() {
         return cryptographicBindingMethodsSupported;
     }
 
+    /**
+     * Get object containing the detailed description of the Credential type.
+     * 
+     * @return Object containing the detailed description of the Credential type
+     */
+    @Nullable
+    public CredentialDefinition getCredentialDefinition() {
+        return credentialDefinition;
+    }
+
     /**
      * Serialize object to json.
      * 
@@ -99,26 +185,16 @@ public class CredentialConfiguration {
     public String serialize() throws JsonProcessingException {
         return new ObjectMapper().writeValueAsString(this);
     }
-
+    
+    /**
+     * Parse {@link CredentialConfiguration} from json string.
+     * 
+     * @param definition {@link CredentialConfiguration} as json string.
+     * @return {@link CredentialDefinition}
+     * @throws JsonProcessingException if parsing fails.
+     */
     public static CredentialConfiguration parse(@Nonnull String configuration) throws JsonProcessingException {
         return new ObjectMapper().readValue(configuration, CredentialConfiguration.class);
 
     }
-
-    @SuppressWarnings("unchecked")
-    public static CredentialConfiguration parse(@Nonnull Object object) throws ParseException {
-        if (object instanceof Map<?, ?> configuration) {
-            String format = configuration.get("format") instanceof String value ? value : null;
-            String scope = configuration.get("scope") instanceof String value ? value : null;
-            List<String> algs = configuration.get("credential_signing_alg_values_supported") instanceof List<?> value
-                    ? (List<String>) value
-                    : null;
-            List<String> methods = configuration.get("cryptographic_binding_methods_supported") instanceof List<?> value
-                    ? (List<String>) value
-                    : null;
-            return new CredentialConfiguration(format, scope, algs, methods);
-        }
-        throw new ParseException("Invalid credential configuration: Parsing failed");
-
-    }
 }
diff --git a/openid-vci-api/src/main/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurations.java b/openid-vci-api/src/main/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurations.java
index 1b56f93..50b8465 100644
--- a/openid-vci-api/src/main/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurations.java
+++ b/openid-vci-api/src/main/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurations.java
@@ -31,11 +31,14 @@ import net.shibboleth.shared.annotation.constraint.NotEmpty;
 import net.shibboleth.shared.resource.Resource;
 
 /**
- * Wraps supported credential configurations. The information wrapped by this
- * class will be used to compare requested credential offer to supported
- * configurations and also for publishing the supported configuration. Not the
- * final implementation yet.
+ * Parses supported credential configurations.
  * 
+ * See
+ * {@link https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#name-credential-issuer-metadata-p}
+ * and parameter credential_configurations_supported.
+ * 
+ * Parsed credential configuration is published to clients and used as a
+ * instruction on how credentials are wrapped to desired format.
  */
 public class CredentialConfigurations {
 
diff --git a/openid-vci-api/src/main/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialDefinition.java b/openid-vci-api/src/main/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialDefinition.java
new file mode 100644
index 0000000..e8526eb
--- /dev/null
+++ b/openid-vci-api/src/main/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialDefinition.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2025, GÉANT
+ *
+ * Licensed under the Apache License, Version 2.0 (the “License”); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an “AS IS” BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.geant.shibboleth.plugin.openidvci.credential;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.nimbusds.oauth2.sdk.ParseException;
+
+/**
+ * Credential definition in {@link CredentialConfiguration} as defined in
+ * {@link https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#name-credential-issuer-metadata-3}
+ * 
+ * For context see {@link https://www.w3.org/TR/vc-data-model/#contexts}. Value
+ * treated here as string. For type see
+ * {@link https://www.w3.org/TR/vc-data-model/#types}. Value treated here as
+ * string.
+ */
+ at JsonIgnoreProperties(ignoreUnknown = true)
+public class CredentialDefinition {
+
+    /** Context of credential definition. */
+    @Nonnull
+    @JsonProperty("@context")
+    private final List<String> context;
+
+    /** Type of credential definition. */
+    @Nonnull
+    @JsonProperty("type")
+    private final List<String> type;
+
+    /**
+     * Constructor.
+     * 
+     * @param context Context of credential definition
+     * @param type    Type of credential definition
+     */
+    private CredentialDefinition(@JsonProperty("@context") @Nullable List<String> context,
+            @JsonProperty("type") @Nullable List<String> type) {
+        assert context != null;
+        assert type != null;
+        this.context = context;
+        this.type = type;
+    }
+
+    /**
+     * Get context of credential definition.
+     * 
+     * @return Context of credential definition
+     */
+    @Nonnull
+    public List<String> getContext() {
+        return context;
+    }
+
+    /**
+     * Get type of credential definition.
+     * 
+     * @return Type of credential definition
+     */
+    @Nonnull
+    public List<String> getType() {
+        return type;
+    }
+
+    /**
+     * Serialize object to json.
+     * 
+     * @return
+     * @throws JsonProcessingException
+     */
+    public String serialize() throws JsonProcessingException {
+        return new ObjectMapper().writeValueAsString(this);
+    }
+
+    /**
+     * Parse {@link CredentialDefinition} from json string.
+     * 
+     * @param definition {@link CredentialDefinition} as json string.
+     * @return {@link CredentialDefinition}
+     * @throws JsonProcessingException if parsing fails.
+     */
+    public static CredentialDefinition parse(@Nonnull String definition) throws JsonProcessingException {
+        return new ObjectMapper().readValue(definition, CredentialDefinition.class);
+
+    }
+
+    @JsonCreator
+    public static CredentialDefinition of(@JsonProperty("@context") @Nullable List<String> context,
+            @JsonProperty("type") @Nullable List<String> type) {
+        if (context == null || type == null) {
+            return null;
+        }
+        return new CredentialDefinition(context, type);
+    }
+}
diff --git a/openid-vci-api/src/test/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurationTest.java b/openid-vci-api/src/test/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurationTest.java
index c9bffe8..211f5e8 100644
--- a/openid-vci-api/src/test/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurationTest.java
+++ b/openid-vci-api/src/test/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurationTest.java
@@ -16,6 +16,8 @@
 
 package org.geant.shibboleth.plugin.openidvci.credential;
 
+import java.io.IOException;
+
 import org.springframework.core.io.ClassPathResource;
 import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
@@ -27,7 +29,7 @@ import com.nimbusds.oauth2.sdk.ParseException;
 import net.shibboleth.shared.spring.resource.ResourceHelper;
 
 /**
- * Unit tests (placeholder) for {@link CredentialConfigurations}.
+ * Unit tests for {@link CredentialConfiguration}.
  */
 public class CredentialConfigurationTest {
 
@@ -36,19 +38,33 @@ public class CredentialConfigurationTest {
     @BeforeMethod
     protected void setUp() throws Exception {
         credential = new String(
-                ResourceHelper.of(new ClassPathResource("credentials/CredentialConfigurationSDJWT.json"))
+                ResourceHelper.of(new ClassPathResource("credentials/CredentialConfiguration_dc+sd-jwt.json"))
                         .getInputStream().readAllBytes());
 
     }
 
     @Test
-    public void parseString() throws ParseException, JsonProcessingException {
+    public void parseSDJWT() throws ParseException, JsonProcessingException {
+
+        CredentialConfiguration configuration = CredentialConfiguration.parse(credential);
+        Assert.assertEquals(configuration.getFormat(), "dc+sd-jwt");
+        Assert.assertEquals(configuration.getScope(), "SD_JWT_VC_example_in_OpenID4VCI");
+        Assert.assertEquals(configuration.getCredentialSigningAlgValuesSupported().get(0), "ES256");
+        Assert.assertEquals(configuration.getCryptographicBindingMethodsSupported().get(0), "jwk");
+
+    }
+
+    @Test
+    public void parseW3CJWTLD() throws ParseException, IOException {
+        credential = new String(
+                ResourceHelper.of(new ClassPathResource("credentials/CredentialConfiguration_jwt_vc_json-ld.json"))
+                        .getInputStream().readAllBytes());
 
-        CredentialConfiguration configurations = CredentialConfiguration.parse(credential);
-        Assert.assertEquals(configurations.getFormat(), "dc+sd-jwt");
-        Assert.assertEquals(configurations.getScope(), "SD_JWT_VC_example_in_OpenID4VCI");
-        Assert.assertEquals(configurations.getCredentialSigningAlgValuesSupported().get(0), "ES256");
-        Assert.assertEquals(configurations.getCryptographicBindingMethodsSupported().get(0), "jwk");
+        CredentialConfiguration configuration = CredentialConfiguration.parse(credential);
+        Assert.assertEquals(configuration.getFormat(), "jwt_vc_json-ld");
+        Assert.assertNull(configuration.getScope());
+        Assert.assertEquals(configuration.getCredentialSigningAlgValuesSupported().get(0), "Ed25519Signature2018");
+        Assert.assertEquals(configuration.getCryptographicBindingMethodsSupported().get(0), "did:example");
 
     }
 
diff --git a/openid-vci-api/src/test/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurationsTest.java b/openid-vci-api/src/test/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurationsTest.java
index 470858e..484b893 100644
--- a/openid-vci-api/src/test/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurationsTest.java
+++ b/openid-vci-api/src/test/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurationsTest.java
@@ -36,10 +36,10 @@ public class CredentialConfigurationsTest {
                 .parse(ResourceHelper.of(new ClassPathResource("credentials/CredentialConfigurationsSupported.json")));
 
         CredentialConfiguration configuration = configurations.getCredentialConfigurations().get("GeantIncubatorSdJwt");
-        Assert.assertEquals(configuration.getFormat(), "vc+sd-jwt");
-        Assert.assertNull(configuration.getScope());
-        Assert.assertNull(configuration.getCredentialSigningAlgValuesSupported());
-        Assert.assertEquals(configuration.getCryptographicBindingMethodsSupported().get(0), "did:web");
+        Assert.assertEquals(configuration.getFormat(), "dc+sd-jwt");
+        Assert.assertEquals(configuration.getScope(),"SD_JWT_VC_example_in_OpenID4VCI");
+        Assert.assertEquals(configuration.getCredentialSigningAlgValuesSupported().get(0),"ES256");
+        Assert.assertEquals(configuration.getCryptographicBindingMethodsSupported().get(0), "jwk");
     }
 
 }
\ No newline at end of file
diff --git a/openid-vci-api/src/test/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurationTest.java b/openid-vci-api/src/test/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialDefinitionTest.java
similarity index 52%
copy from openid-vci-api/src/test/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurationTest.java
copy to openid-vci-api/src/test/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialDefinitionTest.java
index c9bffe8..e55aecd 100644
--- a/openid-vci-api/src/test/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialConfigurationTest.java
+++ b/openid-vci-api/src/test/java/org/geant/shibboleth/plugin/openidvci/credential/CredentialDefinitionTest.java
@@ -27,28 +27,29 @@ import com.nimbusds.oauth2.sdk.ParseException;
 import net.shibboleth.shared.spring.resource.ResourceHelper;
 
 /**
- * Unit tests (placeholder) for {@link CredentialConfigurations}.
+ * Unit tests for {@link CredentialDefinition}.
  */
-public class CredentialConfigurationTest {
+public class CredentialDefinitionTest {
 
-    private String credential;
+    private String definition;
 
     @BeforeMethod
     protected void setUp() throws Exception {
-        credential = new String(
-                ResourceHelper.of(new ClassPathResource("credentials/CredentialConfigurationSDJWT.json"))
-                        .getInputStream().readAllBytes());
-
+        definition = new String(ResourceHelper.of(new ClassPathResource("credentials/CredentialDefinition.json"))
+                .getInputStream().readAllBytes());
     }
 
     @Test
     public void parseString() throws ParseException, JsonProcessingException {
 
-        CredentialConfiguration configurations = CredentialConfiguration.parse(credential);
-        Assert.assertEquals(configurations.getFormat(), "dc+sd-jwt");
-        Assert.assertEquals(configurations.getScope(), "SD_JWT_VC_example_in_OpenID4VCI");
-        Assert.assertEquals(configurations.getCredentialSigningAlgValuesSupported().get(0), "ES256");
-        Assert.assertEquals(configurations.getCryptographicBindingMethodsSupported().get(0), "jwk");
+        CredentialDefinition credentialDefinition = CredentialDefinition.parse(definition);
+        Assert.assertEquals(credentialDefinition.getContext().get(0), "https://www.w3.org/2018/credentials/v1");
+        Assert.assertEquals(credentialDefinition.getContext().get(1),
+                "https://www.w3.org/2018/credentials/examples/v1");
+        Assert.assertEquals(credentialDefinition.getType().get(0), "VerifiableCredential");
+        Assert.assertEquals(credentialDefinition.getType().get(1), "UniversityDegreeCredential");
+        Assert.assertEquals(credentialDefinition.serialize(),
+                "{\"@context\":[\"https://www.w3.org/2018/credentials/v1\",\"https://www.w3.org/2018/credentials/examples/v1\"],\"type\":[\"VerifiableCredential\",\"UniversityDegreeCredential\"]}");
 
     }
 
diff --git a/openid-vci-api/src/test/resources/credentials/CredentialConfiguration_jwt_vc_json-ld.json b/openid-vci-api/src/test/resources/credentials/CredentialConfiguration_jwt_vc_json-ld.json
new file mode 100644
index 0000000..6d4af7f
--- /dev/null
+++ b/openid-vci-api/src/test/resources/credentials/CredentialConfiguration_jwt_vc_json-ld.json
@@ -0,0 +1,77 @@
+{
+    "format": "jwt_vc_json-ld",
+    "cryptographic_binding_methods_supported": [
+        "did:example"
+    ],
+    "credential_signing_alg_values_supported": [
+        "Ed25519Signature2018"
+    ],
+    "credential_definition": {
+        "@context": [
+            "https://www.w3.org/2018/credentials/v1",
+            "https://www.w3.org/2018/credentials/examples/v1"
+        ],
+        "type": [
+            "VerifiableCredential",
+            "UniversityDegreeCredential"
+        ]
+    },
+    "credential_metadata": {
+        "claims": [
+            {
+                "path": [
+                    "credentialSubject",
+                    "given_name"
+                ],
+                "display": [
+                    {
+                        "name": "Given Name",
+                        "locale": "en-US"
+                    }
+                ]
+            },
+            {
+                "path": [
+                    "credentialSubject",
+                    "family_name"
+                ],
+                "display": [
+                    {
+                        "name": "Surname",
+                        "locale": "en-US"
+                    }
+                ]
+            },
+            {
+                "path": [
+                    "credentialSubject",
+                    "degree"
+                ]
+            },
+            {
+                "path": [
+                    "credentialSubject",
+                    "gpa"
+                ],
+                "mandatory": true,
+                "display": [
+                    {
+                        "name": "GPA"
+                    }
+                ]
+            }
+        ],
+        "display": [
+            {
+                "name": "University Credential",
+                "locale": "en-US",
+                "logo": {
+                    "uri": "https://university.example.edu/public/logo.png",
+                    "alt_text": "a square logo of a university"
+                },
+                "background_color": "#12107c",
+                "text_color": "#FFFFFF"
+            }
+        ]
+    }
+}
\ No newline at end of file
diff --git a/openid-vci-api/src/test/resources/credentials/CredentialConfigurationsSupported.json b/openid-vci-api/src/test/resources/credentials/CredentialConfigurationsSupported.json
index 9669154..b85c7f7 100644
--- a/openid-vci-api/src/test/resources/credentials/CredentialConfigurationsSupported.json
+++ b/openid-vci-api/src/test/resources/credentials/CredentialConfigurationsSupported.json
@@ -1,250 +1,222 @@
 {
-  "credential_configurations_supported": {
-    "GeantIncubatorSdJwt": {
-      "format": "vc+sd-jwt",
-      "cryptographic_binding_methods_supported": [
-        "did:web",
-        "did:jwk"
-      ],
-      "cryptographic_suites_supported": [
-        "ES256"
-      ],
-      "display": [
-        {
-          "name": "GeantIncubatorCredential",
-          "description": "Card Credential",
-          "background_color": "rgba(0, 0, 0, 0.2)",
-          "text_color": "#FBFBFB",
-          "logo": {
-            "url": "https://resources.geant.org/wp-content/uploads/2022/02/GEANT_logo_lo_res.jpg",
-            "alt_text": "Geant Incubator logo"
-          }
-        },
-        {
-          "locale": "en-US",
-          "name": "GeantIncubatorCredential",
-          "description": "Geant Incubator statement",
-          "background_color": "rgba(0, 0, 0, 0.2)",
-          "text_color": "#FBFBFB",
-          "logo": {
-            "url": "https://resources.geant.org/wp-content/uploads/2022/02/GEANT_logo_lo_res.jpg",
-            "alt_text": "Geant Incubator logo"
-          }
-        },
-        {
-          "locale": "fi-FI",
-          "name": "GeantIncubatorCredential",
-          "description": "Geant Incubator lausuma",
-          "background_color": "rgba(0, 0, 0, 0.2)",
-          "text_color": "#FBFBFB",
-          "logo": {
-            "url": "https://resources.geant.org/wp-content/uploads/2022/02/GEANT_logo_lo_res.jpg",
-            "alt_text": "Geant Incubator logo"
-          }
-        }
-      ],
-      "vct": "GeantIncubatorSdJwt",
-      "claims": [
-        {
-          "display": [
-            {
-              "description": "Card Information",
-              "label": "Card",
-              "lang": "en-US"
+    "credential_configurations_supported": {
+        "GeantIncubatorSdJwt": {
+            "format": "dc+sd-jwt",
+            "scope": "SD_JWT_VC_example_in_OpenID4VCI",
+            "cryptographic_binding_methods_supported": [
+                "jwk"
+            ],
+            "credential_signing_alg_values_supported": [
+                "ES256"
+            ],
+            "proof_types_supported": {
+                "jwt": {
+                    "proof_signing_alg_values_supported": [
+                        "ES256"
+                    ],
+                    "key_attestations_required": {
+                        "key_storage": [
+                            "iso_18045_moderate"
+                        ],
+                        "user_authentication": [
+                            "iso_18045_moderate"
+                        ]
+                    }
+                }
             },
-            {
-              "description": "Kortin tiedot",
-              "label": "Card",
-              "lang": "fi-FI"
+            "vct": "SD_JWT_VC_example_in_OpenID4VCI",
+            "credential_metadata": {
+                "display": [
+                    {
+                        "name": "IdentityCredential",
+                        "logo": {
+                            "uri": "https://university.example.edu/public/logo.png",
+                            "alt_text": "a square logo of a university"
+                        },
+                        "locale": "en-US",
+                        "background_color": "#12107c",
+                        "text_color": "#FFFFFF"
+                    }
+                ],
+                "claims": [
+                    {
+                        "path": [
+                            "given_name"
+                        ],
+                        "display": [
+                            {
+                                "name": "Given Name",
+                                "locale": "en-US"
+                            },
+                            {
+                                "name": "Vorname",
+                                "locale": "de-DE"
+                            }
+                        ]
+                    },
+                    {
+                        "path": [
+                            "family_name"
+                        ],
+                        "display": [
+                            {
+                                "name": "Surname",
+                                "locale": "en-US"
+                            },
+                            {
+                                "name": "Nachname",
+                                "locale": "de-DE"
+                            }
+                        ]
+                    },
+                    {
+                        "path": [
+                            "email"
+                        ]
+                    },
+                    {
+                        "path": [
+                            "phone_number"
+                        ]
+                    },
+                    {
+                        "path": [
+                            "address"
+                        ],
+                        "display": [
+                            {
+                                "name": "Place of residence",
+                                "locale": "en-US"
+                            },
+                            {
+                                "name": "Wohnsitz",
+                                "locale": "de-DE"
+                            }
+                        ]
+                    },
+                    {
+                        "path": [
+                            "address",
+                            "street_address"
+                        ]
+                    },
+                    {
+                        "path": [
+                            "address",
+                            "locality"
+                        ]
+                    },
+                    {
+                        "path": [
+                            "address",
+                            "region"
+                        ]
+                    },
+                    {
+                        "path": [
+                            "address",
+                            "country"
+                        ]
+                    },
+                    {
+                        "path": [
+                            "birthdate"
+                        ]
+                    },
+                    {
+                        "path": [
+                            "is_over_18"
+                        ]
+                    },
+                    {
+                        "path": [
+                            "is_over_21"
+                        ]
+                    },
+                    {
+                        "path": [
+                            "is_over_65"
+                        ]
+                    }
+                ]
             }
-          ],
-          "path": [
-            "Card"
-          ]
         },
-        {
-          "display": [
-            {
-              "description": "Account Identifier",
-              "label": "Account Identifier",
-              "lang": "en-US"
-            },
-            {
-              "description": "Tilin tunniste",
-              "label": "Tilin tunniste",
-              "lang": "fi-FI"
-            }
-          ],
-          "path": [
-            "Card",
-            "mail"
-          ]
-        },
-        {
-          "display": [
-            {
-              "description": "Personal Information",
-              "label": "Person",
-              "lang": "en-US"
-            },
-            {
-              "description": "Henkilötiedot",
-              "label": "Person",
-              "lang": "fi-FI"
-            }
-          ],
-          "path": [
-            "Person"
-          ]
-        }
-      ],
-      "credential_definition": {
-        "type": [
-          "GeantIncubatorSdJwt"
-        ]
-      }
-    },
-    "GeantIncubatorCredential": {
-      "format": "jwt_vc_json",
-      "cryptographic_binding_methods_supported": [
-        "did:web",
-        "did:jwk"
-      ],
-      "cryptographic_suites_supported": [
-        "ES256"
-      ],
-      "display": [
-        {
-          "name": "GeantIncubatorCredential",
-          "description": "Card Credential",
-          "background_color": "rgba(0, 0, 0, 0.2)",
-          "text_color": "#FBFBFB",
-          "logo": {
-            "url": "https://resources.geant.org/wp-content/uploads/2022/02/GEANT_logo_lo_res.jpg",
-            "alt_text": "Geant Incubator logo"
-          }
-        },
-        {
-          "locale": "en-US",
-          "name": "GeantIncubatorCredential",
-          "description": "Geant Incubator statement",
-          "background_color": "rgba(0, 0, 0, 0.2)",
-          "text_color": "#FBFBFB",
-          "logo": {
-            "url": "https://resources.geant.org/wp-content/uploads/2022/02/GEANT_logo_lo_res.jpg",
-            "alt_text": "Geant Incubator logo"
-          }
-        },
-        {
-          "locale": "fi-FI",
-          "name": "GeantIncubatorCredential",
-          "description": "Geant Incubator lausuma",
-          "background_color": "rgba(0, 0, 0, 0.2)",
-          "text_color": "#FBFBFB",
-          "logo": {
-            "url": "https://resources.geant.org/wp-content/uploads/2022/02/GEANT_logo_lo_res.jpg",
-            "alt_text": "Geant Incubator logo"
-          }
-        }
-      ],
-      "credentialSubject": {
-        "Card": {
-          "display": [
-            {
-              "name": "Card Information"
-            },
-            {
-              "name": "Card Information",
-              "locale": "en-US"
-            },
-            {
-              "name": "Kortin tiedot",
-              "locale": "fi-FI"
-            }
-          ],
-          "mail": {
-            "display": [
-              {
-                "name": "Account Identifier"
-              },
-              {
-                "name": "Account Identifier",
-                "locale": "en-US"
-              },
-              {
-                "name": "Tilin tunniste",
-                "locale": "fi-FI"
-              }
-            ]
-          }
-        },
-        "Person": {
-          "display": [
-            {
-              "name": "Personal Information"
-            },
-            {
-              "name": "Personal Information",
-              "locale": "en-US"
+        "GeantIncubatorCredential": {
+            "format": "jwt_vc_json-ld",
+            "cryptographic_binding_methods_supported": [
+                "did:example"
+            ],
+            "credential_signing_alg_values_supported": [
+                "Ed25519Signature2018"
+            ],
+            "credential_definition": {
+                "@context": [
+                    "https://www.w3.org/2018/credentials/v1",
+                    "https://www.w3.org/2018/credentials/examples/v1"
+                ],
+                "type": [
+                    "VerifiableCredential",
+                    "UniversityDegreeCredential"
+                ]
             },
-            {
-              "name": "Henkilötiedot",
-              "locale": "fi-FI"
+            "credential_metadata": {
+                "claims": [
+                    {
+                        "path": [
+                            "credentialSubject",
+                            "given_name"
+                        ],
+                        "display": [
+                            {
+                                "name": "Given Name",
+                                "locale": "en-US"
+                            }
+                        ]
+                    },
+                    {
+                        "path": [
+                            "credentialSubject",
+                            "family_name"
+                        ],
+                        "display": [
+                            {
+                                "name": "Surname",
+                                "locale": "en-US"
+                            }
+                        ]
+                    },
+                    {
+                        "path": [
+                            "credentialSubject",
+                            "degree"
+                        ]
+                    },
+                    {
+                        "path": [
+                            "credentialSubject",
+                            "gpa"
+                        ],
+                        "mandatory": true,
+                        "display": [
+                            {
+                                "name": "GPA"
+                            }
+                        ]
+                    }
+                ],
+                "display": [
+                    {
+                        "name": "University Credential",
+                        "locale": "en-US",
+                        "logo": {
+                            "uri": "https://university.example.edu/public/logo.png",
+                            "alt_text": "a square logo of a university"
+                        },
+                        "background_color": "#12107c",
+                        "text_color": "#FFFFFF"
+                    }
+                ]
             }
-          ],
-          "eppn": {
-            "display": [
-              {
-                "name": "Learner Identifier"
-              },
-              {
-                "name": "Learner Identifier",
-                "locale": "en-US"
-              },
-              {
-                "name": "Oppijanumero",
-                "locale": "fi-FI"
-              }
-            ]
-          },
-          "family_name": {
-            "display": [
-              {
-                "name": "Family Name"
-              },
-              {
-                "name": "Family Name",
-                "locale": "en-US"
-              },
-              {
-                "name": "Achternaam",
-                "locale": "nl-NL"
-              }
-            ]
-          },
-          "given_name": {
-            "display": [
-              {
-                "name": "Given Name"
-              },
-              {
-                "name": "Given Name",
-                "locale": "en-US"
-              },
-              {
-                "name": "Voornaam",
-                "locale": "nl-NL"
-              }
-            ]
-          }
         }
-      },
-      "credential_definition": {
-        "type": [
-          "VerifiableCredential",
-          "GeantIncubatorCredential"
-        ]
-      }
     }
-  }
 }
\ No newline at end of file
diff --git a/openid-vci-api/src/test/resources/credentials/CredentialDefinition.json b/openid-vci-api/src/test/resources/credentials/CredentialDefinition.json
new file mode 100644
index 0000000..5a74cd9
--- /dev/null
+++ b/openid-vci-api/src/test/resources/credentials/CredentialDefinition.json
@@ -0,0 +1,10 @@
+{
+	"@context": [
+		"https://www.w3.org/2018/credentials/v1",
+		"https://www.w3.org/2018/credentials/examples/v1"
+	],
+	"type": [
+		"VerifiableCredential",
+		"UniversityDegreeCredential"
+	]
+}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list