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
credentials
property in a credential offer has been renamed tocredential_configurations
. In addition, theuser_pin_required
boolean property has been replaced with thetx_code
JSON object.Another breaking change. The
credential_configurations
property 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 String
getAcr()
Get the Authentication Context Class Reference of the user authentication performed during the course of issuing the credential offer.long
getAuthTime()
Get the time when the user authentication was performed during the course of issuing the credential offer.String
getContext()
Get the general-purpose arbitrary string.String[]
getCredentialConfigurationIds()
Get the value of thecredential_configuration_ids
property of the credential offer.URI
getCredentialIssuer()
Get the identifier of the credential issuer.String
getCredentialOffer()
Get the credential offer in the JSON format.long
getExpiresAt()
Get the time at which the credential offer will expire.String
getIdentifier()
Get the identifier of the credential offer.String
getIssuerState()
Get the value of theissuer_state
property in theauthorization_code
object in thegrants
object.String
getJwtAtClaims()
Get the additional claims in JSON object format that are added to the payload part of the JWT access token.String
getPreAuthorizedCode()
Get the value of thepre-authorized_code
property in theurn:ietf:params:oauth:grant-type:pre-authorized_code
object in thegrants
object.Property[]
getProperties()
Get the extra properties associated with the credential offer.String
getSubject()
Get the subject associated with the credential offer.String
getTxCode()
Get the transaction code.String
getTxCodeDescription()
Get the description of the transaction code.String
getTxCodeInputMode()
Get the input mode of the transaction code.boolean
isAuthorizationCodeGrantIncluded()
Get the flag indicating whether theauthorization_code
object is included in thegrants
object.boolean
isIssuerStateIncluded()
Get the flag indicating whether theissuer_state
property is included in theauthorization_code
object in thegrants
object.boolean
isPreAuthorizedCodeGrantIncluded()
Get the flag indicating whether theurn:ietf:params:oauth:grant-type:pre-authorized_code
object is included in thegrants
object.CredentialOfferInfo
setAcr(String acr)
Set the Authentication Context Class Reference of the user authentication performed during the course of issuing the credential offer.CredentialOfferInfo
setAuthorizationCodeGrantIncluded(boolean included)
Set the flag indicating whether theauthorization_code
object is included in thegrants
object.CredentialOfferInfo
setAuthTime(long authTime)
Set the time when the user authentication was performed during the course of issuing the credential offer.CredentialOfferInfo
setContext(String context)
Set the general-purpose arbitrary string.CredentialOfferInfo
setCredentialConfigurationIds(String[] ids)
Set the value of thecredential_configuration_ids
property of the credential offer.CredentialOfferInfo
setCredentialIssuer(URI issuer)
Set the identifier of the credential issuer.CredentialOfferInfo
setCredentialOffer(String offer)
Set the credential offer in the JSON format.CredentialOfferInfo
setExpiresAt(long expiresAt)
Set the time at which the credential offer will expire.CredentialOfferInfo
setIdentifier(String identifier)
Set the identifier of the credential offer.CredentialOfferInfo
setIssuerState(String state)
Set the value of theissuer_state
property in theauthorization_code
object in thegrants
object.CredentialOfferInfo
setIssuerStateIncluded(boolean included)
Set the flag indicating whether theissuer_state
property is included in theauthorization_code
object in thegrants
object.CredentialOfferInfo
setJwtAtClaims(String claims)
Set the additional claims in JSON object format that are added to the payload part of the JWT access token.CredentialOfferInfo
setPreAuthorizedCode(String code)
Set the value of thepre-authorized_code
property in theurn:ietf:params:oauth:grant-type:pre-authorized_code
object in thegrants
object.CredentialOfferInfo
setPreAuthorizedCodeGrantIncluded(boolean included)
Set the flag indicating whether theurn:ietf:params:oauth:grant-type:pre-authorized_code
object is included in thegrants
object.CredentialOfferInfo
setProperties(Property[] properties)
Set the extra properties associated with the credential offer.CredentialOfferInfo
setSubject(String subject)
Set the subject associated with the credential offer.CredentialOfferInfo
setTxCode(String txCode)
Set the transaction code.CredentialOfferInfo
setTxCodeDescription(String description)
Set the description of the transaction code.CredentialOfferInfo
setTxCodeInputMode(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:
this
object.
-
getCredentialOffer
public String getCredentialOffer()
Get the credential offer in the JSON format.The value is suitable for use as the value of the
credential_offer
parameter 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_uri
parameter.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_offer
parameter 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_uri
parameter.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:
this
object.
-
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:
this
object.- Since:
- 3.60
-
getCredentialConfigurationIds
public String[] getCredentialConfigurationIds()
Get the value of thecredential_configuration_ids
property of the credential offer.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { ... } }
The type of the object returned from this method has been changed from
String
toString[]
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
credentials
property in a credential offer has been renamed tocredential_configurations
.NOTE: A breaking change again. The
credential_configurations
property has been renamed tocredential_configuration_ids
.- Returns:
- The value of the
credential_configuration_ids
property of the credential offer. - Since:
- 3.93
-
setCredentialConfigurationIds
public CredentialOfferInfo setCredentialConfigurationIds(String[] ids)
Set the value of thecredential_configuration_ids
property of the credential offer.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { ... } }
NOTE: Due to the breaking change made in December 2023, the
credentials
property in a credential offer has been renamed tocredential_configurations
.NOTE: A breaking change again. The
credential_configurations
property has been renamed tocredential_configuration_ids
.- Parameters:
ids
- The value of thecredential_configuration_ids
property of the credential offer.- Returns:
this
object.- Since:
- 3.93
-
isAuthorizationCodeGrantIncluded
public boolean isAuthorizationCodeGrantIncluded()
Get the flag indicating whether theauthorization_code
object is included in thegrants
object.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "authorization_code": { ... } } }
- Returns:
true
if theauthorization_code
object is included in thegrants
object.
-
setAuthorizationCodeGrantIncluded
public CredentialOfferInfo setAuthorizationCodeGrantIncluded(boolean included)
Set the flag indicating whether theauthorization_code
object is included in thegrants
object.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "authorization_code": { ... } } }
- Parameters:
included
-true
to indicate that theauthorization_code
object is included in thegrants
object.- Returns:
this
object.
-
isIssuerStateIncluded
public boolean isIssuerStateIncluded()
Get the flag indicating whether theissuer_state
property is included in theauthorization_code
object in thegrants
object.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "authorization_code": { "issuer_state": "..." } } }
- Returns:
true
if theissuer_state
property is included in theauthorization_code
object in thegrants
object.
-
setIssuerStateIncluded
public CredentialOfferInfo setIssuerStateIncluded(boolean included)
Set the flag indicating whether theissuer_state
property is included in theauthorization_code
object in thegrants
object.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "authorization_code": { "issuer_state": "..." } } }
- Parameters:
included
-true
to indicate that theissuer_state
property is included in theauthorization_code
object in thegrants
object.- Returns:
this
object.
-
getIssuerState
public String getIssuerState()
Get the value of theissuer_state
property in theauthorization_code
object in thegrants
object.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "authorization_code": { "issuer_state": "..." } } }
- Returns:
- The value of the
issuer_state
property in theauthorization_code
object in thegrants
object.
-
setIssuerState
public CredentialOfferInfo setIssuerState(String state)
Set the value of theissuer_state
property in theauthorization_code
object in thegrants
object.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "authorization_code": { "issuer_state": "..." } } }
- Parameters:
state
- The value of theissuer_state
property in theauthorization_code
object in thegrants
object.- Returns:
this
object.
-
isPreAuthorizedCodeGrantIncluded
public boolean isPreAuthorizedCodeGrantIncluded()
Get the flag indicating whether theurn:ietf:params:oauth:grant-type:pre-authorized_code
object is included in thegrants
object.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "urn:ietf:params:oauth:grant-type:pre-authorized_code": { ... } } }
- Returns:
true
if theurn:ietf:params:oauth:grant-type:pre-authorized_code
object is included in thegrants
object.
-
setPreAuthorizedCodeGrantIncluded
public CredentialOfferInfo setPreAuthorizedCodeGrantIncluded(boolean included)
Set the flag indicating whether theurn:ietf:params:oauth:grant-type:pre-authorized_code
object is included in thegrants
object.{ "credential_issuer": "...", "credential_configuration_ids": [ ... ], "grants": { "urn:ietf:params:oauth:grant-type:pre-authorized_code": { ... } } }
- Parameters:
included
-true
to indicate that theurn:ietf:params:oauth:grant-type:pre-authorized_code
object is included in thegrants
object.- Returns:
this
object.
-
getPreAuthorizedCode
public String getPreAuthorizedCode()
Get the value of thepre-authorized_code
property in theurn:ietf:params:oauth:grant-type:pre-authorized_code
object in thegrants
object.{ "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_code
property in theurn:ietf:params:oauth:grant-type:pre-authorized_code
object in thegrants
object.
-
setPreAuthorizedCode
public CredentialOfferInfo setPreAuthorizedCode(String code)
Set the value of thepre-authorized_code
property in theurn:ietf:params:oauth:grant-type:pre-authorized_code
object in thegrants
object.{ "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_code
property in theurn:ietf:params:oauth:grant-type:pre-authorized_code
object in thegrants
object.- Returns:
this
object.
-
getSubject
public String getSubject()
Get the subject associated with the credential offer.This property holds the value specified by the
subject
request parameter passed to the/vci/offer/create
API.- 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
subject
request parameter passed to the/vci/offer/create
API.- Parameters:
subject
- The value of the subject.- Returns:
this
object.- 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:
this
object.
-
getContext
public String getContext()
Get the general-purpose arbitrary string.This property holds the value specified by the
context
request parameter passed to the/vci/offer/create
API.- 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
context
request parameter passed to the/vci/offer/create
API.- Parameters:
context
- The general-purpose arbitrary string.- Returns:
this
object.- 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:
this
object.- 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
accessTokenSignAlg
property of theService
holds 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
accessTokenSignAlg
property of theService
holds 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:
this
object.- 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:
this
object.- 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:
this
object.- 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:
this
object.- 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:
this
object.- 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:
this
object.- Since:
- 3.91
-
-