Interface CredentialBuilder

All Superinterfaces:
Provider
All Known Implementing Classes:
JwtCredentialBuilder, LDCredentialBuilder, SdJwtCredentialBuilder

public interface CredentialBuilder extends Provider
  • Method Details

    • close

      default void close()
      Specified by:
      close in interface Provider
    • getSupportedFormat

      String getSupportedFormat()
      Returns the credential format supported by the builder.
    • buildCredentialBody

      CredentialBody buildCredentialBody(VerifiableCredential verifiableCredential, CredentialBuildConfig credentialBuildConfig) throws CredentialBuilderException
      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.

      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

      default void contributeToMetadata(SupportedCredentialConfiguration credentialConfig, CredentialScopeModel credentialScope)
      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.

      Parameters:
      credentialConfig - the credential configuration to populate with format-specific metadata
      credentialScope - the credential scope model containing the source data