Class JwtCredentialBuilder

java.lang.Object
org.keycloak.protocol.oid4vc.issuance.credentialbuilder.JwtCredentialBuilder
All Implemented Interfaces:
CredentialBuilder, Provider

public class JwtCredentialBuilder extends Object implements CredentialBuilder
  • Constructor Details

  • Method Details

    • getSupportedFormat

      public String getSupportedFormat()
      Description copied from interface: CredentialBuilder
      Returns the credential format supported by the builder.
      Specified by:
      getSupportedFormat in interface CredentialBuilder
    • buildCredentialBody

      public JwtCredentialBody buildCredentialBody(VerifiableCredential verifiableCredential, CredentialBuildConfig credentialBuildConfig) throws CredentialBuilderException
      Description copied from interface: CredentialBuilder
      Builds a verifiable credential of a specific format from the basis of an internal representation of the credential.

      The credential is built incompletely, intended that it would be signed externally.

      Specified by:
      buildCredentialBody in interface CredentialBuilder
      Parameters:
      verifiableCredential - an internal representation of the credential
      credentialBuildConfig - additional configurations for building the credential
      Returns:
      the built verifiable credential of the specific format, ready to be signed
      Throws:
      CredentialBuilderException
    • contributeToMetadata

      public void contributeToMetadata(SupportedCredentialConfiguration credentialConfig, CredentialScopeModel credentialScope)
      Description copied from interface: CredentialBuilder
      Allows the credential builder to contribute format-specific metadata to the OID4VCI well-known credential issuer metadata.

      Implementations should add only the metadata fields required by the supported credential format (for example vct for dc+sd-jwt or credential_definition for jwt_vc_json).

      The default implementation is a no-op to preserve backward compatibility.

      Specified by:
      contributeToMetadata in interface CredentialBuilder
      Parameters:
      credentialConfig - the credential configuration to populate with format-specific metadata
      credentialScope - the credential scope model containing the source data