Class CredentialIssuerMetadata
- java.lang.Object
-
- com.authlete.common.dto.CredentialIssuerMetadata
-
- All Implemented Interfaces:
Serializable
public class CredentialIssuerMetadata extends Object implements Serializable
A class that represents the set of credential issuer metadata. The set consists of the following:Parameter Spec Version 1.0-ID1 1.0-Final credential_issuer✓ ✓ authorization_servers✓ ✓ credential_endpoint✓ ✓ batch_credential_endpoint✓ deprecated deferred_credential_endpoint✓ ✓ notification_endpoint✓ ✓ nonce_endpoint✓ credential_request_encryption✓ credential_response_encryption✓ ✓ batch_credential_issuance✓ display✓ ✓ credential_configurations_supported✓ ✓ The following parameters, which existed in the 1.0-ID1 version but have removed from the 1.0-Final version, are not supported by Authlete from the beginning:
credential_identifiers_supportedsigned_metadata
A credential issuer announces these metadata at
/.well-known/openid-credential-issuer.Breaking Changes
The "OpenID for Verifiable Credential Issuance" specification tends to repeat breaking changes. Such changes affect this Java class. The following are notable changes.
-
The type of the "
credentials_supported" metadata has been changed from a JSON array to a JSON object. -
The "
authorization_server" metadata has been renamed to "authorization_servers", and its type has been changed from a string to a JSON array. -
The "
credentials_supported" metadata has been renamed to "credential_configurations_supported". (December, 2023) -
The "
credential_response_encryption_alg_values_supported" metadata, the "credential_response_encryption_enc_values_supported" metadata, and the "require_credential_response_encryption" metadata have been packed into one JSON object, "credential_response_encryption". (January, 2024)
- Since:
- 3.55, Authlete 3.0
- See Also:
- OpenID for Verifiable Credential Issuance 1.0, OpenID for Verifiable Credential Issuance 1.0, Implementer's Draft 1, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CredentialIssuerMetadata()The default constructor.CredentialIssuerMetadata(CredentialIssuerMetadata metadata)Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URI[]getAuthorizationServers()Get the identifiers of the authorization servers that the credential issuer relies on for authorization.URIgetBatchCredentialEndpoint()Get the URL of the batch credential endpoint.intgetBatchSize()Get the maximum array size for theproofsparameter in a credential request.URIgetCredentialEndpoint()Get the URL of the credential endpoint.URIgetCredentialIssuer()Get the identifier of the credential issuer.JWEEnc[]getCredentialRequestEncryptionEncValuesSupported()Get the supported JWEencalgorithms for credential request encryption.StringgetCredentialRequestEncryptionJwks()Get the JWK Set for credential request encryption.JWEZip[]getCredentialRequestEncryptionZipValuesSupported()Get the supported JWEzipalgorithms for credential request encryption.JWEAlg[]getCredentialResponseEncryptionAlgValuesSupported()Get the supported JWEalgalgorithms for credential response encryption.JWEEnc[]getCredentialResponseEncryptionEncValuesSupported()Get the supported JWEencalgorithms for credential response encryption.JWEZip[]getCredentialResponseEncryptionZipValuesSupported()Get the supported JWEzipalgorithms for credential response encryption.StringgetCredentialsSupported()Get the information about supported credential configurations in the JSON format.URIgetDeferredCredentialEndpoint()Get the URL of the deferred credential endpoint.StringgetDisplay()Get the display properties of this credential issuer in JSON array format.URIgetNonceEndpoint()Get the URL of the nonce endpoint.URIgetNotificationEndpoint()Get the URL of the notification endpoint.booleanisEmpty()Check if all properties of this instance are null.booleanisRequireCredentialRequestEncryption()Get the boolean flag indicating whether credential request encryption is required.booleanisRequireCredentialResponseEncryption()Get the boolean flag indicating whether credential response encryption is required.CredentialIssuerMetadatasetAuthorizationServers(URI[] servers)Set the identifiers of the authorization servers that the credential issuer relies on for authorization.CredentialIssuerMetadatasetBatchCredentialEndpoint(URI endpoint)Set the URL of the batch credential endpoint.CredentialIssuerMetadatasetBatchSize(int batchSize)Set the maximum array size for theproofsparameter in a credential request.CredentialIssuerMetadatasetCredentialEndpoint(URI endpoint)Set the URL of the credential endpoint.CredentialIssuerMetadatasetCredentialIssuer(URI issuer)Set the identifier of the credential issuer.CredentialIssuerMetadatasetCredentialRequestEncryptionEncValuesSupported(JWEEnc[] encs)Set the supported JWEencalgorithms for credential request encryption.CredentialIssuerMetadatasetCredentialRequestEncryptionJwks(String jwks)Set the JWK Set for credential request encryption.CredentialIssuerMetadatasetCredentialRequestEncryptionZipValuesSupported(JWEZip[] zips)Set the supported JWEzipalgorithms for credential request encryption.CredentialIssuerMetadatasetCredentialResponseEncryptionAlgValuesSupported(JWEAlg[] algs)Set the supported JWEalgalgorithms for credential response encryption.CredentialIssuerMetadatasetCredentialResponseEncryptionEncValuesSupported(JWEEnc[] encs)Set the supported JWEencalgorithms for credential response encryption.CredentialIssuerMetadatasetCredentialResponseEncryptionZipValuesSupported(JWEZip[] zips)Set the supported JWEzipalgorithms for credential response encryption.CredentialIssuerMetadatasetCredentialsSupported(String credentialsSupported)Set the information about supported credential configurations in the JSON format.CredentialIssuerMetadatasetDeferredCredentialEndpoint(URI endpoint)Set the URL of the deferred credential endpoint.CredentialIssuerMetadatasetDisplay(String display)Set the display properties of this credential issuer in JSON array format.CredentialIssuerMetadatasetNonceEndpoint(URI endpoint)Set the URL of the nonce endpoint.CredentialIssuerMetadatasetNotificationEndpoint(URI endpoint)Set the URL of the notification endpoint.CredentialIssuerMetadatasetRequireCredentialRequestEncryption(boolean required)Set the boolean flag indicating whether credential request encryption is required.CredentialIssuerMetadatasetRequireCredentialResponseEncryption(boolean required)Set the boolean flag indicating whether credential response encryption is required.Map<String,Object>toMap()Create aMapinstance that represents a JSON object conforming to the format of the credential issuer metadata defined in "OpenID for Verifiable Credential Issuance".
-
-
-
Constructor Detail
-
CredentialIssuerMetadata
public CredentialIssuerMetadata()
The default constructor.
-
CredentialIssuerMetadata
public CredentialIssuerMetadata(CredentialIssuerMetadata metadata)
Copy constructor.- Parameters:
metadata- Source to copy data from.nullwon't raise any exception.
-
-
Method Detail
-
getCredentialIssuer
public URI getCredentialIssuer()
Get the identifier of the credential issuer. This property corresponds to thecredential_issuermetadata.To make the feature of credential issuance function, this property must be set.
- Returns:
- The identifier of the credential issuer.
-
setCredentialIssuer
public CredentialIssuerMetadata setCredentialIssuer(URI issuer)
Set the identifier of the credential issuer. This property corresponds to thecredential_issuermetadata.To make the feature of credential issuance function, this property must be set.
- Parameters:
issuer- The identifier of the credential issuer.- Returns:
thisobject.
-
getAuthorizationServers
public URI[] getAuthorizationServers()
Get the identifiers of the authorization servers that the credential issuer relies on for authorization. This property corresponds to theauthorization_serversmetadata.When the credential issuer works as an authorization server for itself, this property should be omitted.
- Returns:
- The identifiers of the authorization servers that the credential issuer relies on for authorization.
- Since:
- 3.86
-
setAuthorizationServers
public CredentialIssuerMetadata setAuthorizationServers(URI[] servers)
Set the identifiers of the authorization servers that the credential issuer relies on for authorization. This property corresponds to theauthorization_serversmetadata.When the credential issuer works as an authorization server for itself, this property should be omitted.
- Parameters:
servers- The identifiers of the authorization servers that the credential issuer relies on for authorization.- Returns:
thisobject.- Since:
- 3.86
-
getCredentialEndpoint
public URI getCredentialEndpoint()
Get the URL of the credential endpoint. This property corresponds to thecredential_endpointmetadata.To make the feature of credential issuance function, this property must be set.
- Returns:
- The URL of the credential endpoint.
-
setCredentialEndpoint
public CredentialIssuerMetadata setCredentialEndpoint(URI endpoint)
Set the URL of the credential endpoint. This property corresponds to thecredential_endpointmetadata.To make the feature of credential issuance function, this property must be set.
- Parameters:
endpoint- The URL of the credential endpoint.- Returns:
thisobject.
-
getBatchCredentialEndpoint
public URI getBatchCredentialEndpoint()
Get the URL of the batch credential endpoint. This property corresponds to thebatch_credential_endpointmetadata.If the credential issuer does not support the batch credential endpoint, this property should be omitted.
NOTE: This metadata parameter was deprecated and is not available in the 1.0-Final version of the OID4VCI specification.
- Returns:
- The URL of the batch credential endpoint.
-
setBatchCredentialEndpoint
public CredentialIssuerMetadata setBatchCredentialEndpoint(URI endpoint)
Set the URL of the batch credential endpoint. This property corresponds to thebatch_credential_endpointmetadata.If the credential issuer does not support the batch credential endpoint, this property should be omitted.
NOTE: This metadata parameter was deprecated and is not available in the 1.0-Final version of the OID4VCI specification.
- Parameters:
endpoint- The URL of the batch credential endpoint.- Returns:
thisobject.
-
getDeferredCredentialEndpoint
public URI getDeferredCredentialEndpoint()
Get the URL of the deferred credential endpoint. This property corresponds to thedeferred_credential_endpointmetadata.If the credential issuer does not support the deferred credential endpoint, this property should be omitted.
- Returns:
- The URL of the deferred credential endpoint.
- Since:
- 3.59
-
setDeferredCredentialEndpoint
public CredentialIssuerMetadata setDeferredCredentialEndpoint(URI endpoint)
Set the URL of the deferred credential endpoint. This property corresponds to thedeferred_credential_endpointmetadata.If the credential issuer does not support the deferred credential endpoint, this property should be omitted.
- Parameters:
endpoint- The URL of the deferred credential endpoint.- Returns:
thisobject.- Since:
- 3.59
-
getNotificationEndpoint
public URI getNotificationEndpoint()
Get the URL of the notification endpoint. This property corresponds to thenotification_endpointmetadata.- Returns:
- The URL of the notification endpoint.
- Since:
- 4.26
-
setNotificationEndpoint
public CredentialIssuerMetadata setNotificationEndpoint(URI endpoint)
Set the URL of the notification endpoint. This property corresponds to thenotification_endpointmetadata.- Parameters:
endpoint- The URL of the notification endpoint.- Returns:
thisobject.- Since:
- 4.26
-
getNonceEndpoint
public URI getNonceEndpoint()
Get the URL of the nonce endpoint. This property corresponds to thenonce_endpointmetadata.NOTE: This metadata parameter exists in the 1.0-Final version of the OID4VCI specification but is not available in the 1.0-ID1 version.
- Returns:
- The URL of the nonce endpoint.
- Since:
- 4.26
-
setNonceEndpoint
public CredentialIssuerMetadata setNonceEndpoint(URI endpoint)
Set the URL of the nonce endpoint. This property corresponds to thenonce_endpointmetadata.NOTE: This metadata parameter exists in the 1.0-Final version of the OID4VCI specification but is not available in the 1.0-ID1 version.
- Parameters:
endpoint- The URL of the nonce endpoint.- Returns:
thisobject.- Since:
- 4.26
-
getCredentialRequestEncryptionJwks
public String getCredentialRequestEncryptionJwks()
Get the JWK Set for credential request encryption.The public part of this JWK Set is used as the value of the
credential_request_encryption.jwksmetadata.NOTE: This metadata parameter exists in the 1.0-Final version of the OID4VCI specification but is not available in the 1.0-ID1 version.
- Returns:
- The JWK Set for credential request encryption.
- Since:
- 4.26
-
setCredentialRequestEncryptionJwks
public CredentialIssuerMetadata setCredentialRequestEncryptionJwks(String jwks)
Set the JWK Set for credential request encryption.The public part of this JWK Set is used as the value of the
credential_request_encryption.jwksmetadata.NOTE: This metadata parameter exists in the 1.0-Final version of the OID4VCI specification but is not available in the 1.0-ID1 version.
- Parameters:
jwks- The JWK Set for credential request encryption.- Returns:
thisobject.- Since:
- 4.26
-
getCredentialRequestEncryptionEncValuesSupported
public JWEEnc[] getCredentialRequestEncryptionEncValuesSupported()
Get the supported JWEencalgorithms for credential request encryption. This property corresponds to thecredential_request_encryption.enc_values_supportedmetadata.NOTE: This metadata parameter exists in the 1.0-Final version of the OID4VCI specification but is not available in the 1.0-ID1 version.
- Returns:
- The supported JWE
encalgorithms for credential request encryption. - Since:
- 4.26
-
setCredentialRequestEncryptionEncValuesSupported
public CredentialIssuerMetadata setCredentialRequestEncryptionEncValuesSupported(JWEEnc[] encs)
Set the supported JWEencalgorithms for credential request encryption. This property corresponds to thecredential_request_encryption.enc_values_supportedmetadata.NOTE: This metadata parameter exists in the 1.0-Final version of the OID4VCI specification but is not available in the 1.0-ID1 version.
- Parameters:
encs- The supported JWEencalgorithms for credential request encryption.- Returns:
thisobject.- Since:
- 4.26
-
getCredentialRequestEncryptionZipValuesSupported
public JWEZip[] getCredentialRequestEncryptionZipValuesSupported()
Get the supported JWEzipalgorithms for credential request encryption. This property corresponds to thecredential_request_encryption.zip_values_supportedmetadata.NOTE: This metadata parameter exists in the 1.0-Final version of the OID4VCI specification but is not available in the 1.0-ID1 version.
- Returns:
- The supported JWE
zipalgorithms for credential request encryption. - Since:
- 4.26
-
setCredentialRequestEncryptionZipValuesSupported
public CredentialIssuerMetadata setCredentialRequestEncryptionZipValuesSupported(JWEZip[] zips)
Set the supported JWEzipalgorithms for credential request encryption. This property corresponds to thecredential_request_encryption.zip_values_supportedmetadata.NOTE: This metadata parameter exists in the 1.0-Final version of the OID4VCI specification but is not available in the 1.0-ID1 version.
- Parameters:
zips- The supported JWEzipalgorithms for credential request encryption.- Returns:
thisobject.- Since:
- 4.26
-
isRequireCredentialRequestEncryption
public boolean isRequireCredentialRequestEncryption()
Get the boolean flag indicating whether credential request encryption is required. This property corresponds to thecredential_request_encryption.encryption_requiredmetadata.If this flag is
true, every credential request to the credential issuer must be encrypted.- Returns:
trueif credential request encryption is required.- Since:
- 4.26
-
setRequireCredentialRequestEncryption
public CredentialIssuerMetadata setRequireCredentialRequestEncryption(boolean required)
Set the boolean flag indicating whether credential request encryption is required. This property corresponds to thecredential_request_encryption.encryption_requiredmetadata.If this flag is
true, every credential request to the credential issuer must be encrypted- Parameters:
required-trueto require credential request encryption.- Returns:
thisobject.- Since:
- 4.26
-
getCredentialResponseEncryptionAlgValuesSupported
public JWEAlg[] getCredentialResponseEncryptionAlgValuesSupported()
Get the supported JWEalgalgorithms for credential response encryption. This property corresponds to thecredential_response_encryption.alg_values_supportedmetadata.- Returns:
- The supported JWE
algalgorithms for credential response encryption. - Since:
- 3.86
-
setCredentialResponseEncryptionAlgValuesSupported
public CredentialIssuerMetadata setCredentialResponseEncryptionAlgValuesSupported(JWEAlg[] algs)
Set the supported JWEalgalgorithms for credential response encryption. This property corresponds to thecredential_response_encryption.alg_values_supportedmetadata.- Parameters:
algs- The supported JWEalgalgorithms for credential response encryption.- Returns:
thisobject.- Since:
- 3.86
-
getCredentialResponseEncryptionEncValuesSupported
public JWEEnc[] getCredentialResponseEncryptionEncValuesSupported()
Get the supported JWEencalgorithms for credential response encryption. This property corresponds to thecredential_response_encryption.enc_values_supportedmetadata.- Returns:
- The supported JWE
encalgorithms for credential response encryption. - Since:
- 3.86
-
setCredentialResponseEncryptionEncValuesSupported
public CredentialIssuerMetadata setCredentialResponseEncryptionEncValuesSupported(JWEEnc[] encs)
Set the supported JWEencalgorithms for credential response encryption. This property corresponds to thecredential_response_encryption.enc_values_supportedmetadata.- Parameters:
encs- The supported JWEencalgorithms for credential response encryption.- Returns:
thisobject.- Since:
- 3.86
-
getCredentialResponseEncryptionZipValuesSupported
public JWEZip[] getCredentialResponseEncryptionZipValuesSupported()
Get the supported JWEzipalgorithms for credential response encryption. This property corresponds to thecredential_response_encryption.zip_values_supportedmetadata.NOTE: This metadata parameter exists in the 1.0-Final version of the OID4VCI specification but is not available in the 1.0-ID1 version.
- Returns:
- The supported JWE
zipalgorithms for credential response encryption. - Since:
- 4.26
-
setCredentialResponseEncryptionZipValuesSupported
public CredentialIssuerMetadata setCredentialResponseEncryptionZipValuesSupported(JWEZip[] zips)
Set the supported JWEzipalgorithms for credential response encryption. This property corresponds to thecredential_response_encryption.zip_values_supportedmetadata.NOTE: This metadata parameter exists in the 1.0-Final version of the OID4VCI specification but is not available in the 1.0-ID1 version.
- Parameters:
zips- The supported JWEzipalgorithms for credential response encryption.- Returns:
thisobject.- Since:
- 4.26
-
isRequireCredentialResponseEncryption
public boolean isRequireCredentialResponseEncryption()
Get the boolean flag indicating whether credential response encryption is required. This property corresponds to thecredential_response_encryption.encryption_requiredmetadata.If this flag is
true, every credential request to the credential issuer must include thecredential_response_encryptionproperty.- Returns:
trueif credential response encryption is required.- Since:
- 3.86
-
setRequireCredentialResponseEncryption
public CredentialIssuerMetadata setRequireCredentialResponseEncryption(boolean required)
Set the boolean flag indicating whether credential response encryption is required. This property corresponds to thecredential_response_encryption.encryption_requiredmetadata.If this flag is
true, every credential request to the credential issuer must include thecredential_response_encryptionproperty.- Parameters:
required-trueto require credential response encryption.- Returns:
thisobject.- Since:
- 3.86
-
getBatchSize
public int getBatchSize()
Get the maximum array size for theproofsparameter in a credential request. This property corresponds to thebatch_credential_issuance.batch_sizemetadata.If the value of this property is 2 or greater, the
batch_credential_issuanceparameter will appear in the response from the credential metadata endpoint.NOTE: This metadata parameter exists in the 1.0-Final version of the OID4VCI specification but is not available in the 1.0-ID1 version.
- Returns:
- The maximum array size for the
proofsparameter in a credential request. - Since:
- 4.26
-
setBatchSize
public CredentialIssuerMetadata setBatchSize(int batchSize)
Set the maximum array size for theproofsparameter in a credential request. This property corresponds to thebatch_credential_issuance.batch_sizemetadata.If the value of this property is 2 or greater, the
batch_credential_issuanceparameter will appear in the response from the credential metadata endpoint.NOTE: This metadata parameter exists in the 1.0-Final version of the OID4VCI specification but is not available in the 1.0-ID1 version.
- Parameters:
batchSize- The maximum array size for theproofsparameter in a credential request.- Returns:
thisobject.- Since:
- 4.26
-
getDisplay
public String getDisplay()
Get the display properties of this credential issuer in JSON array format.The following is an example of
displayvalue excerpted from Appendix I.1. Credential IssuerMetadata of the OID4VCI specification.[ { "name": "Example University", "locale": "en-US", "logo": { "uri": "https://university.example.edu/public/logo.png", "alt_text":"a square logo of a university" } }, { "name": "Example Université", "locale": "fr-FR", "logo": { "uri": "https://university.example.edu/public/logo.png", "alt_text":"Un logo universitaire carré" } } ]- Returns:
- The display properties.
- Since:
- 4.26
-
setDisplay
public CredentialIssuerMetadata setDisplay(String display)
Set the display properties of this credential issuer in JSON array format.The following is an example of
displayvalue excerpted from Appendix I.1. Credential IssuerMetadata of the OID4VCI specification.[ { "name": "Example University", "locale": "en-US", "logo": { "uri": "https://university.example.edu/public/logo.png", "alt_text":"a square logo of a university" } }, { "name": "Example Université", "locale": "fr-FR", "logo": { "uri": "https://university.example.edu/public/logo.png", "alt_text":"Un logo universitaire carré" } } ]- Parameters:
display- The display properties.- Returns:
thisobject.- Since:
- 4.26
-
getCredentialsSupported
public String getCredentialsSupported()
Get the information about supported credential configurations in the JSON format. This property corresponds to thecredential_configurations_supportedmetadata.To make the feature of credential issuance function, this property must be set.
NOTE: Due to the breaking change of the "OpenID for Verifiable Credential Issuance" specification, the type of the content of this "
credentialsSupported" property has been changed from a JSON array to a JSON object.NOTE: Due to another breaking change made in December 2023, the
credentials_supportedmetadata has been renamed tocredential_configurations_supported.- Returns:
- The supported credential configurations. If not null, the value is a string representing a JSON object.
-
setCredentialsSupported
public CredentialIssuerMetadata setCredentialsSupported(String credentialsSupported)
Set the information about supported credential configurations in the JSON format. This property corresponds to thecredential_configurations_supportedmetadata.To make the feature of credential issuance function, this property must be set.
NOTE: Due to the breaking change of the "OpenID for Verifiable Credential Issuance" specification, the type of the content of this "
credentialsSupported" property has been changed from a JSON array to a JSON object.NOTE: Due to another breaking change made in December 2023, the
credentials_supportedmetadata has been renamed tocredential_configurations_supported.- Parameters:
credentialsSupported- The supported credential configurations. If not null, the value is a string representing a JSON object.- Returns:
thisobject.
-
isEmpty
public boolean isEmpty()
Check if all properties of this instance are null.- Returns:
trueif all properties are null.
-
toMap
public Map<String,Object> toMap()
Create aMapinstance that represents a JSON object conforming to the format of the credential issuer metadata defined in "OpenID for Verifiable Credential Issuance".The following is an example of
Mapcontent.{ "credential_issuer": "https://credential-issuer.example.com", "authorization_servers": [ "https://authorization-server.example.com" ], "credential_endpoint": "https://credential-issuer.example.com/credential", "batch_credential_endpoint": "https://credential-issuer.example.com/batch_credential", "deferred_credential_endpoint": "https://credential-issuer.example.com/deferred_credential", "credential_configurations_supported": { "UniversityDegreeCredential": { "format": "jwt_vc_json", "scope": "UniversityDegree", "cryptographic_binding_methods_supported": [ "did:example" ], "cryptographic_suites_supported": [ "ES256K" ], "credential_definition": { "type": [ "VerifiableCredential", "UniversityDegreeCredential" ], "credentialSubject": { "given_name": {}, "family_name": {}, "degree": {}, "gpa": {} } } } } }NOTE: Due to the breaking change of the "OpenID for Verifiable Credential Issuance" specification, the type of the "
credentials_supported" property has been changed from a JSON array to a JSON object.NOTE: Due to another breaking change made in December 2023, the
credentials_supportedmetadata has been renamed tocredential_configurations_supported.- Returns:
- A
Mapinstance that represents a JSON object conforming to the format of the credential issuer metadata. - Throws:
IllegalStateException- The value of thecredentialsSupportedproperty failed to be parsed as a JSON object.
-
-