The TrustBloc Wallet SDK v1.1 supports JSON-LD Verifiable Credential (VC) format, OpenID4VCI Authorization Code Issuance protocol, and minor bug fixes.
What's New
SDK
OpenID4VCI Authorization Code flow
Support for W3C Verifiable Credential (VC) JSON-LD format
Support for BBS+ Selective Disclosure Crypto
Golang v1.20 upgrade
Update to JWT proof validation logic
Reference App
Support for OpenID4VCI Authorization Code flow
Support for W3C Verifiable Credential (VC) JSON-LD format
Breaking Changes
Interaction Args
Before
Kotlin
import dev.trustbloc.wallet.sdk.openid4ci.*
val args = Args(...)
val opts = Opts(...)
Swift
let args = Openid4ciNewArgs(...)
let opts = Openid4ciNewOpts(...)
After
Kotlin
import dev.trustbloc.wallet.sdk.openid4ci.*
val args = InteractionArgs(...)
val opts = InteractionOpts(...)
Swift
let interactionArgs = Openid4ciNewInteractionArgs(...)
let interactionOpts = Openid4ciNewInteractionOpts(...)
Pre-authorized Code Flow
Before
Kotlin
val result = interaction.authorize()
val credentials: CredentialsArray
if (result.UserPINRequired) {
credentials = interaction.requestCredentialWithPIN(didDocResolution.assertionMethod(), "1234")
} else {
credentials = interaction.requestCredential(didDocResolution.assertionMethod())
}
Swift
let result = interaction.authorize()
var credentials: VerifiableCredentialsArray
if result.UserPINRequired {
credentials = interaction.requestCredential(withPIN: didDocResolution.assertionMethod(), pin:"1234")
} else {
credentials = interaction.requestCredential(didDocResolution.assertionMethod())
}
After
Kotlin
// It's a good idea to check the issuer's capabilities first
if (!interaction.preAuthorizedCodeGrantTypeSupported()) {
// This code example isn't applicable.
return
}
val requestCredentialWithPreAuthOpts = RequestCredentialWithPreAuthOpts()
if (interaction.preAuthorizedCodeGrantParams().pinRequired()) {
requestCredentialWithPreAuthOpts.setPIN("1234")
}
val credentials = interaction.requestCredentialWithPreAuth(didDocResolution.assertionMethod(), requestCredentialWithPreAuthOpts)
Swift
// It's a good idea to check the issuer's capabilities first
if !interaction.preAuthorizedCodeGrantTypeSupported() {
// This code example isn't applicable.
return
}
let requestCredentialWithPreAuthOpts = Openid4ciRequestCredentialWithPreAuthOpts()
if (issuerCapabilities.preAuthorizedCodeGrantParams().pinRequired()) {
requestCredentialWithPreAuthOpts!.setPIN("1234")
}
let credentials = interaction.requestCredential(withPreAuth: didDocResolution.assertionMethod(), opts: requestCredentialWithPreAuthOpts)
Credential Inquirer
Before
Swift
let inquirer = CredentialNewInquirer(nil)
After
Swift
var newInquirerError: NSError?
let inquirer = CredentialNewInquirer(nil, &newInquirerError)
Depreciated APIs
The methods used in the "before" examples are deprecated and should be replaced with their equivalents
in the "after" methods. The deprecated methods will be removed in a future version. In this version,
the deprecated methods still exist, but simply act as aliases for the newer methods.
val requestCredentialWithPreAuthOpts = RequestCredentialWithPreAuthOpts()
if (pinRequired) {
requestCredentialWithPreAuthOpts.setPIN("1234")
}
val credentials = interaction.requestCredentialWithPreAuth(didDocResolution.assertionMethod(), requestCredentialWithPreAuthOpts)
Swift
let requestCredentialWithPreAuthOpts = Openid4ciRequestCredentialWithPreAuthOpts()
if pinRequired {
requestCredentialWithPreAuthOpts!.setPIN("1234")
}
let credentials = interaction.requestCredential(withPreAuth: didDocResolution.assertionMethod(), opts: requestCredentialWithPreAuthOpts)
1.1.0
The TrustBloc Wallet SDK v1.1 supports JSON-LD Verifiable Credential (VC) format, OpenID4VCI Authorization Code Issuance protocol, and minor bug fixes.
What's New
Breaking Changes
Interaction Args
Before
Kotlin
Swift
After
Kotlin
Swift
Pre-authorized Code Flow
Before
Kotlin
Swift
After
Kotlin
Swift
Credential Inquirer
Before
Swift
After
Swift
Depreciated APIs
The methods used in the "before" examples are deprecated and should be replaced with their equivalents in the "after" methods. The deprecated methods will be removed in a future version. In this version, the deprecated methods still exist, but simply act as aliases for the newer methods.
Pre-authorized Code Flow
Before
Kotlin
Swift
After
Kotlin
Swift