Class CredentialOfferInfo
- java.lang.Object
-
- com.authlete.common.dto.CredentialOfferInfo
-
- All Implemented Interfaces:
Serializable
public class CredentialOfferInfo extends Object implements Serializable
Information about a credential offer.Breaking Changes
The "OpenID for Verifiable Credential Issuance" specification tends to repeat breaking changes. Such changes affect this Java class.
In the past draft of the specification, elements in the "
credentials" array in a credential offer are either strings or JSON objects. Therefore, the type of the "credentials" property in the previous implementation of this class was a "string" whose content must be able to be parsed as a JSON array. However, as a result of a breaking change in the specification, it is ensured that all elements in the "credentials" array in a credential offer are strings. To make it easier to treat the "credentials" property of this class, the type of the property has been changed from a string to an array of strings.Due to another breaking change made in December 2023, the
credentialsproperty in a credential offer has been renamed tocredential_configurations. In addition, theuser_pin_requiredboolean property has been replaced with thetx_codeJSON object.Another breaking change. The
credential_configurationsproperty has been renamed tocredential_configuration_ids.- Since:
- 3.59, Authlete 3.0
- See Also:
- OpenID for Verifiable Credential Issuance, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CredentialOfferInfo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAcr()Get the Authentication Context Class Reference of the user authentication performed during the course of issuing the credential offer.longgetAuthTime()Get the time when the user authentication was performed during the course of issuing the credential offer.StringgetContext()Get the general-purpose arbitrary string.String[]getCredentialConfigurationIds()Get the value of thecredential_configuration_idsproperty of the credential offer.URIgetCredentialIssuer()Get the identifier of the credential issuer.StringgetCredentialOffer()Get the credential offer in the JSON format.longgetExpiresAt()Get the time at which the credential offer will expire.StringgetIdentifier()Get the identifier of the credential offer.StringgetIssuerState()Get the value of theissuer_stateproperty in theauthorization_codeobject in thegrantsobject.StringgetJwtAtClaims()Get the additional claims in JSON object format that are added to the payload part of the JWT access token.StringgetPreAuthorizedCode()Get the value of thepre-authorized_codeproperty in theurn:ietf:params:oauth:grant-type:pre-authorized_codeobject in thegrantsobject.Property[]getProperties()Get the extra properties associated with the credential offer.StringgetSubject()Get the subject associated with the credential offer.StringgetTxCode()Get the transaction code.StringgetTxCodeDescription()Get the description of the transaction code.StringgetTxCodeInputMode()Get the input mode of the transaction code.booleanisAuthorizationCodeGrantIncluded()Get the flag indicating whether theauthorization_codeobject is included in thegrantsobject.booleanisIssuerStateIncluded()Get the flag indicating whether theissuer_stateproperty is included in theauthorization_codeobject in thegrantsobject.booleanisPreAuthorizedCodeGrantIncluded()Get the flag indicating whether theurn:ietf:params:oauth:grant-type:pre-authorized_codeobject is included in thegrantsobject.CredentialOfferInfosetAcr(String acr)Set the Authentication Context Class Reference of the user authentication performed during the course of issuing the credential offer.CredentialOfferInfosetAuthorizationCodeGrantIncluded(boolean included)Set the flag indicating whether theauthorization_codeobject is included in thegrantsobject.CredentialOfferInfosetAuthTime(long authTime)Set the time when the user authentication was performed during the course of issuing the credential offer.CredentialOfferInfosetContext(String context)Set the general-purpose arbitrary string.CredentialOfferInfosetCredentialConfigurationIds(String[] ids)Set the value of thecredential_configuration_idsproperty of the credential offer.CredentialOfferInfosetCredentialIssuer(URI issuer)Set the identifier of the credential issuer.CredentialOfferInfosetCredentialOffer(String offer)Set the credential offer in the JSON format.CredentialOfferInfosetExpiresAt(long expiresAt)Set the time at which the credential offer will expire.CredentialOfferInfosetIdentifier(String identifier)Set the identifier of the credential offer.CredentialOfferInfosetIssuerState(String state)Set the value of theissuer_stateproperty in theauthorization_codeobject in thegrantsobject.CredentialOfferInfosetIssuerStateIncluded(boolean included)Set the flag indicating whether theissuer_stateproperty is included in theauthorization_codeobject in thegrantsobject.CredentialOfferInfosetJwtAtClaims(String claims)Set the additional claims in JSON object format that are added to the payload part of the JWT access token.CredentialOfferInfosetPreAuthorizedCode(String code)Set the value of thepre-authorized_codeproperty in theurn:ietf:params:oauth:grant-type:pre-authorized_codeobject in thegrantsobject.CredentialOfferInfosetPreAuthorizedCodeGrantIncluded(boolean included)Set the flag indicating whether theurn:ietf:params:oauth:grant-type:pre-authorized_codeobject is included in thegrantsobject.CredentialOfferInfosetProperties(Property[] properties)Set the extra properties associated with the credential offer.CredentialOfferInfosetSubject(String subject)Set the subject associated with the credential offer.CredentialOfferInfosetTxCode(String txCode)Set the transaction code.CredentialOfferInfosetTxCodeDescription(String description)Set the description of the transaction code.CredentialOfferInfosetTxCodeInputMode(String inputMode)Set the input mode of the transaction code.
-
-
-
Method Detail
-
getIdentifier
public String getIdentifier()
Get the identifier of the credential offer.The identifier is a base64url string with 256-bit entropy consisting of 43 characters.
- Returns:
- The identifier of the credential offer.
-
setIdentifier
public CredentialOfferInfo setIdentifier(String identifier)
Set the identifier of the credential offer.The identifier is a base64url string with 256-bit entropy consisting of 43 characters.
- Parameters:
identifier- The identifier of the credential offer.- Returns:
thisobject.
-
getCredentialOffer
public String getCredentialOffer()
Get the credential offer in the JSON format.The value is suitable for use as the value of the
credential_offerparameter which is sent to the credential offer endpoint of the wallet. It is also suitable as the message body of a response returned from the endpoint designated by thecredential_offer_uriparameter.The credential offer holds JSON like below.
{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "authorization_code": { "issuer_state": "..." }, "urn:ietf:params:oauth:grant-type:pre-authorized_code": { "pre-authorized_code": "...", "tx_code": { "input_mode": "numeric", "length": 6, "description": "..." } } } }- Returns:
- The credential offer in the JSON format.
-
setCredentialOffer
public CredentialOfferInfo setCredentialOffer(String offer)
Set the credential offer in the JSON format.The value is suitable for use as the value of the
credential_offerparameter which is sent to the credential offer endpoint of the wallet. It is also suitable as the message body of a response returned from the endpoint designated by thecredential_offer_uriparameter.The credential offer should hold JSON like below.
{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "authorization_code": { "issuer_state": "..." }, "urn:ietf:params:oauth:grant-type:pre-authorized_code": { "pre-authorized_code": "...", "tx_code": { "input_mode": "numeric", "length": 6, "description": "..." } } } }- Parameters:
offer- The credential offer in the JSON format.- Returns:
thisobject.
-
getCredentialIssuer
public URI getCredentialIssuer()
Get the identifier of the credential issuer.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { ... } }- Returns:
- The identifier of the credential issuer.
- Since:
- 3.60
-
setCredentialIssuer
public CredentialOfferInfo setCredentialIssuer(URI issuer)
Set the identifier of the credential issuer.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { ... } }- Parameters:
issuer- The identifier of the credential issuer.- Returns:
thisobject.- Since:
- 3.60
-
getCredentialConfigurationIds
public String[] getCredentialConfigurationIds()
Get the value of thecredential_configuration_idsproperty of the credential offer.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { ... } }The type of the object returned from this method has been changed from
StringtoString[]since version 3.86 to align with the breaking change of the OID4VCI specification.NOTE: Due to the breaking change made in December 2023, the
credentialsproperty in a credential offer has been renamed tocredential_configurations.NOTE: A breaking change again. The
credential_configurationsproperty has been renamed tocredential_configuration_ids.- Returns:
- The value of the
credential_configuration_idsproperty of the credential offer. - Since:
- 3.93
-
setCredentialConfigurationIds
public CredentialOfferInfo setCredentialConfigurationIds(String[] ids)
Set the value of thecredential_configuration_idsproperty of the credential offer.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { ... } }NOTE: Due to the breaking change made in December 2023, the
credentialsproperty in a credential offer has been renamed tocredential_configurations.NOTE: A breaking change again. The
credential_configurationsproperty has been renamed tocredential_configuration_ids.- Parameters:
ids- The value of thecredential_configuration_idsproperty of the credential offer.- Returns:
thisobject.- Since:
- 3.93
-
isAuthorizationCodeGrantIncluded
public boolean isAuthorizationCodeGrantIncluded()
Get the flag indicating whether theauthorization_codeobject is included in thegrantsobject.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "authorization_code": { ... } } }- Returns:
trueif theauthorization_codeobject is included in thegrantsobject.
-
setAuthorizationCodeGrantIncluded
public CredentialOfferInfo setAuthorizationCodeGrantIncluded(boolean included)
Set the flag indicating whether theauthorization_codeobject is included in thegrantsobject.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "authorization_code": { ... } } }- Parameters:
included-trueto indicate that theauthorization_codeobject is included in thegrantsobject.- Returns:
thisobject.
-
isIssuerStateIncluded
public boolean isIssuerStateIncluded()
Get the flag indicating whether theissuer_stateproperty is included in theauthorization_codeobject in thegrantsobject.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "authorization_code": { "issuer_state": "..." } } }- Returns:
trueif theissuer_stateproperty is included in theauthorization_codeobject in thegrantsobject.
-
setIssuerStateIncluded
public CredentialOfferInfo setIssuerStateIncluded(boolean included)
Set the flag indicating whether theissuer_stateproperty is included in theauthorization_codeobject in thegrantsobject.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "authorization_code": { "issuer_state": "..." } } }- Parameters:
included-trueto indicate that theissuer_stateproperty is included in theauthorization_codeobject in thegrantsobject.- Returns:
thisobject.
-
getIssuerState
public String getIssuerState()
Get the value of theissuer_stateproperty in theauthorization_codeobject in thegrantsobject.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "authorization_code": { "issuer_state": "..." } } }- Returns:
- The value of the
issuer_stateproperty in theauthorization_codeobject in thegrantsobject.
-
setIssuerState
public CredentialOfferInfo setIssuerState(String state)
Set the value of theissuer_stateproperty in theauthorization_codeobject in thegrantsobject.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "authorization_code": { "issuer_state": "..." } } }- Parameters:
state- The value of theissuer_stateproperty in theauthorization_codeobject in thegrantsobject.- Returns:
thisobject.
-
isPreAuthorizedCodeGrantIncluded
public boolean isPreAuthorizedCodeGrantIncluded()
Get the flag indicating whether theurn:ietf:params:oauth:grant-type:pre-authorized_codeobject is included in thegrantsobject.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "urn:ietf:params:oauth:grant-type:pre-authorized_code": { ... } } }- Returns:
trueif theurn:ietf:params:oauth:grant-type:pre-authorized_codeobject is included in thegrantsobject.
-
setPreAuthorizedCodeGrantIncluded
public CredentialOfferInfo setPreAuthorizedCodeGrantIncluded(boolean included)
Set the flag indicating whether theurn:ietf:params:oauth:grant-type:pre-authorized_codeobject is included in thegrantsobject.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "urn:ietf:params:oauth:grant-type:pre-authorized_code": { ... } } }- Parameters:
included-trueto indicate that theurn:ietf:params:oauth:grant-type:pre-authorized_codeobject is included in thegrantsobject.- Returns:
thisobject.
-
getPreAuthorizedCode
public String getPreAuthorizedCode()
Get the value of thepre-authorized_codeproperty in theurn:ietf:params:oauth:grant-type:pre-authorized_codeobject in thegrantsobject.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "urn:ietf:params:oauth:grant-type:pre-authorized_code": { "pre-authorized_code": "..." } } }- Returns:
- The value of the
pre-authorized_codeproperty in theurn:ietf:params:oauth:grant-type:pre-authorized_codeobject in thegrantsobject.
-
setPreAuthorizedCode
public CredentialOfferInfo setPreAuthorizedCode(String code)
Set the value of thepre-authorized_codeproperty in theurn:ietf:params:oauth:grant-type:pre-authorized_codeobject in thegrantsobject.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "urn:ietf:params:oauth:grant-type:pre-authorized_code": { "pre-authorized_code": "..." } } }- Parameters:
code- The value of thepre-authorized_codeproperty in theurn:ietf:params:oauth:grant-type:pre-authorized_codeobject in thegrantsobject.- Returns:
thisobject.
-
getSubject
public String getSubject()
Get the subject associated with the credential offer.This property holds the value specified by the
subjectrequest parameter passed to the/vci/offer/createAPI.- Returns:
- The value of the subject.
- See Also:
CredentialOfferCreateRequest.getSubject()
-
setSubject
public CredentialOfferInfo setSubject(String subject)
Set the subject associated with the credential offer.This property should hold the value specified by the
subjectrequest parameter passed to the/vci/offer/createAPI.- Parameters:
subject- The value of the subject.- Returns:
thisobject.- See Also:
CredentialOfferCreateRequest.setSubject(String)
-
getExpiresAt
public long getExpiresAt()
Get the time at which the credential offer will expire.- Returns:
- The time at which the credential offer will expire. The value represents milliseconds elapsed since the Unix epoch.
-
setExpiresAt
public CredentialOfferInfo setExpiresAt(long expiresAt)
Set the time at which the credential offer will expire.- Parameters:
expiresAt- The time at which the credential offer will expire. The value represents milliseconds elapsed since the Unix epoch.- Returns:
thisobject.
-
getContext
public String getContext()
Get the general-purpose arbitrary string.This property holds the value specified by the
contextrequest parameter passed to the/vci/offer/createAPI.- Returns:
- The general-purpose arbitrary string.
- See Also:
CredentialOfferCreateRequest.getContext()
-
setContext
public CredentialOfferInfo setContext(String context)
Set the general-purpose arbitrary string.This property should hold the value specified by the
contextrequest parameter passed to the/vci/offer/createAPI.- Parameters:
context- The general-purpose arbitrary string.- Returns:
thisobject.- See Also:
CredentialOfferCreateRequest.setContext(String)
-
getProperties
public Property[] getProperties()
Get the extra properties associated with the credential offer. Extra properties are general-purpose key-value pairs.The extra properties will be eventually associated with an access token which will be created based on the credential offer.
- Returns:
- The extra properties associated with the credential offer.
- Since:
- 3.62
-
setProperties
public CredentialOfferInfo setProperties(Property[] properties)
Set the extra properties associated with the credential offer. Extra properties are general-purpose key-value pairs.The extra properties will be eventually associated with an access token which will be created based on the credential offer.
- Parameters:
properties- The extra properties associated with the credential offer.- Returns:
thisobject.- Since:
- 3.62
-
getJwtAtClaims
public String getJwtAtClaims()
Get the additional claims in JSON object format that are added to the payload part of the JWT access token.This property has a meaning only when the format of access tokens issued by the service is JWT. In other words, it has a meaning only when the
accessTokenSignAlgproperty of theServiceholds a non-null value. See the description of thegetAccessTokenSignAlg()method for details.The additional claims will be eventually associated with an access token which will be created based on the credential offer.
- Returns:
- Additional claims that are added to the payload part of the JWT access token.
- Since:
- 3.62
-
setJwtAtClaims
public CredentialOfferInfo setJwtAtClaims(String claims)
Set the additional claims in JSON object format that are added to the payload part of the JWT access token.This property has a meaning only when the format of access tokens issued by the service is JWT. In other words, it has a meaning only when the
accessTokenSignAlgproperty of theServiceholds a non-null value. See the description of thegetAccessTokenSignAlg()method for details.The additional claims will be eventually associated with an access token which will be created based on the credential offer.
- Parameters:
claims- Additional claims that are added to the payload part of the JWT access token.- Returns:
thisobject.- Since:
- 3.62
-
getAuthTime
public long getAuthTime()
Get the time when the user authentication was performed during the course of issuing the credential offer.- Returns:
- The time of the user authentication in seconds since the Unix epoch.
- Since:
- 3.62
-
setAuthTime
public CredentialOfferInfo setAuthTime(long authTime)
Set the time when the user authentication was performed during the course of issuing the credential offer.- Parameters:
authTime- The time of the user authentication in seconds since the Unix epoch.- Returns:
thisobject.- Since:
- 3.62
-
getAcr
public String getAcr()
Get the Authentication Context Class Reference of the user authentication performed during the course of issuing the credential offer.- Returns:
- The Authentication Context Class Reference.
- Since:
- 3.62
-
setAcr
public CredentialOfferInfo setAcr(String acr)
Set the Authentication Context Class Reference of the user authentication performed during the course of issuing the credential offer.- Parameters:
acr- The Authentication Context Class Reference.- Returns:
thisobject.- Since:
- 3.62
-
getTxCode
public String getTxCode()
Get the transaction code.- Returns:
- The transaction code.
- Since:
- 3.91
-
setTxCode
public CredentialOfferInfo setTxCode(String txCode)
Set the transaction code.- Parameters:
txCode- The transaction code.- Returns:
thisobject.- Since:
- 3.91
-
getTxCodeInputMode
public String getTxCodeInputMode()
Get the input mode of the transaction code.- Returns:
- The input mode of the transaction code.
- Since:
- 3.91
-
setTxCodeInputMode
public CredentialOfferInfo setTxCodeInputMode(String inputMode)
Set the input mode of the transaction code.- Parameters:
inputMode- The input mode of the transaction code. Such as "numeric" and "text".- Returns:
thisobject.- Since:
- 3.91
-
getTxCodeDescription
public String getTxCodeDescription()
Get the description of the transaction code.- Returns:
- The description of the transaction code.
- Since:
- 3.91
-
setTxCodeDescription
public CredentialOfferInfo setTxCodeDescription(String description)
Set the description of the transaction code.- Parameters:
description- The description of the transaction code.- Returns:
thisobject.- Since:
- 3.91
-
-