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.credential_issuerauthorization_serverscredential_endpointbatch_credential_endpointdeferred_credential_endpointcredential_response_encryptioncredential_configurations_supported
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, OpenID for Verifiable Credential Issuance, Working Draft, 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.URIgetCredentialEndpoint()Get the URL of the credential endpoint.URIgetCredentialIssuer()Get the identifier of the credential issuer.JWEAlg[]getCredentialResponseEncryptionAlgValuesSupported()Get the supported JWEalgalgorithms for credential response encryption.JWEEnc[]getCredentialResponseEncryptionEncValuesSupported()Get the supported JWEencalgorithms 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.booleanisEmpty()Check if all properties of this instance are null.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.CredentialIssuerMetadatasetCredentialEndpoint(URI endpoint)Set the URL of the credential endpoint.CredentialIssuerMetadatasetCredentialIssuer(URI issuer)Set the identifier of the credential issuer.CredentialIssuerMetadatasetCredentialResponseEncryptionAlgValuesSupported(JWEAlg[] algs)Set the supported JWEalgalgorithms for credential response encryption.CredentialIssuerMetadatasetCredentialResponseEncryptionEncValuesSupported(JWEEnc[] encs)Set the supported JWEencalgorithms 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.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.
- 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.
- Parameters:
endpoint- The URL of the batch credential endpoint.- Returns:
-
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
-
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
-
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
-
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.
-
-