Skip to content

1.0.0-rc4

Compare
Choose a tag to compare
@rolsonquadras rolsonquadras released this 17 Apr 13:58
· 494 commits to main since this release
fbb5544

1.0.0-rc4

What's New

  • SDK
    • New VC Status API for revocation check
    • Support for Verifiable Credential (VC) JSON-LD format
    • Fixes to Well-Known DID Configuration API
    • Enable Tracing by default in Issuance and Presentation flow with option to disable
    • SDK API refactoring to follow common API patterns
  • Reference App
    • Support to display VC Revocation Status
    • Support to display Issuer /Verifier Domain and DID validation
    • Support to select DID method and key type

Breaking Changes

The examples don't show any optional parameters being used. The optional parameters are passed in via the last argument of a function or method.
Note: for Objective-C/Swift functions that return an error, the optional parameters struct will be the second last parameter, since the last parameter is always used for the error return.

In the examples below, it's always null/nil, indicating that default options should be used. See the usage documentation
for more information.

Credential Parsing

Kotlin (Before)

import dev.trustbloc.wallet.sdk.api.*
import dev.trustbloc.wallet.sdk.credential.*

val vc = Vcparse.parse("Serialized VC goes here", null)

Kotlin (After)

import dev.trustbloc.wallet.sdk.verifiable.Verifiable

val vc = Verifiable.parseCredential("Serialized VC goes here", null)

Swift (Before)

import Walletsdk

var error: NSError?
let vc = VcparseParse("VC JSON goes here", nil, &error)

Swift (After)

import Walletsdk

var error: NSError?
let vc = VerifiableParseCredential("Serialized VC goes here", nil, &error)

DID Resolver

Kotlin (Before)

import dev.trustbloc.wallet.sdk.did.*

val didResolver = did.Resolver("")

val didDoc = didResolver.resolve("did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK")

Kotlin (After)

import dev.trustbloc.wallet.sdk.did.*

val didResolver = did.Resolver(null)

val didDoc = didResolver.resolve("did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK")

Swift (Before)

import Walletsdk

var error: NSError?
let didResolver = DidNewResolver("", &error)

let didDoc = didResolver.resolve("did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK")

Swift (After)

import Walletsdk

var error: NSError?
let didResolver = DidNewResolver(&error)

let didDoc = didResolver.resolve("did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK")

OpenID4CI

Kotlin (Before)

import dev.trustbloc.wallet.sdk.localkms.Localkms
import dev.trustbloc.wallet.sdk.localkms.MemKMSStore
import dev.trustbloc.wallet.sdk.did.Resolver
import dev.trustbloc.wallet.sdk.did.Creator
import dev.trustbloc.wallet.sdk.openid4ci.Interaction
import dev.trustbloc.wallet.sdk.openid4ci.ClientConfig
import dev.trustbloc.wallet.sdk.openid4ci.CredentialRequestOpts
import dev.trustbloc.wallet.sdk.openid4ci.mem

// Setup
val memKMSStore = MemKMSStore.MemKMSStore()
val kms = Localkms.newKMS(memKMSStore)
val didResolver = Resolver("")
val didCreator = Creator(kms as KeyWriter)
val didDocResolution = didCreator.create("key", CreateDIDOpts()) // Create a did:key doc
val cfg = ClientConfig("ClientID", kms.crypto, didResolver, null)

// Going through the flow
val interaction = Interaction("YourRequestURIHere", cfg)
interaction.authorize() // Check this to determine whether a PIN is needed or not
val userPIN = "1234"
val requestCredentialOpts = CredentialRequestOpts(userPIN)
val credentials = interaction.requestCredential(requestCredentialOpts, didDocResolution.assertionMethod()) // Should probably store these somewhere
val issuerURI = interaction.issuerURI() // Optional (but useful)

Kotlin (After)

import dev.trustbloc.wallet.sdk.localkms.Localkms
import dev.trustbloc.wallet.sdk.localkms.MemKMSStore
import dev.trustbloc.wallet.sdk.did.Resolver
import dev.trustbloc.wallet.sdk.did.Creator
import dev.trustbloc.wallet.sdk.openid4ci.*
import dev.trustbloc.wallet.sdk.openid4ci.Opts
import dev.trustbloc.wallet.sdk.verifiable.CredentialsArray

// Setup
val memKMSStore = MemKMSStore.MemKMSStore()
val kms = Localkms.newKMS(memKMSStore)
val didResolver = Resolver(null)
val didCreator = Creator(kms as KeyWriter)
val didDocResolution = didCreator.create("key", null) // Create a did:key doc

// Going through the flow
val args = Args("YourRequestURIHere", "ClientID", kms.getCrypto(), didResolver)
val interaction = Interaction(args, null)

val result = interaction.authorize()

val credentials: CredentialsArray

if (result.UserPINRequired) {
  credentials = interaction.requestCredentialWithPIN(didVerificationMethod, "1234")
} else {
  credentials = interaction.requestCredential(didDocResolution.assertionMethod())
}

val issuerURI = interaction.issuerURI() // Optional (but useful)

Swift (Before)

import Walletsdk

// Setup
let memKMSStore = LocalkmsNewMemKMSStore()

var newKMSError: NSError?
let kms = LocalkmsNewKMS(memKMSStore, &newKMSError)

let didResolver = DidNewResolver("", nil)

var newDIDCreatorError: NSError?
let didCreator = DidNewCreator(kms, &newDIDCreatorError)

let didDocResolution = didCreator.create("key", nil) // Create a did:key doc
let cfg = Openid4ciClientConfig(didDocResolution.id, clientID: "ClientID", didRes: didResolver, activityLogger: nil)

// Going through the flow
var newInteractionError: NSError?
let interaction = Openid4ciNewInteraction("YourRequestURIHere", cfg, &newInteractionError)
interaction.authorize() // Check returned object to see whether a PIN is needed or not
let userPIN = "1234"
let requestCredentialOpts = Openid4ciNewCredentialRequestOpts(userPIN)
let credentials = interaction.requestCredential(requestCredentialOpts, didDocResolution.assertionMethod()) // Should probably store these somewhere
let issuerURI = interaction.issuerURI() // Optional (but useful)

Swift (After)

import Walletsdk

// Setup
let memKMSStore = LocalkmsNewMemKMSStore()

var newKMSError: NSError?
let kms = LocalkmsNewKMS(memKMSStore, &newKMSError)

let didResolver = DidNewResolver(nil)

var newDIDCreatorError: NSError?
let didCreator = DidNewCreator(kms, &newDIDCreatorError)

let didDocResolution = didCreator.create("key", nil) // Create a did:key doc with default options

// Going through the flow
let args = Openid4ciNewArgs("YourRequestURIHere", "ClientID", kms.getCrypto(), didResolver)
var newInteractionError: NSError?
let interaction = Openid4ciNewInteraction(args, nil, &newInteractionError)

let result = interaction.authorize()

var credentials: VerifiableCredentialsArray

if result.UserPINRequired {
  credentials = interaction.requestCredential(withPIN: didDocResolution.assertionMethod(), pin:"1234")
} else {
  credentials = interaction.requestCredential(didDocResolution.assertionMethod())
}

let issuerURI = interaction.issuerURI() // Optional (but useful)

Credential Display Data

Kotlin (Before)

import dev.trustbloc.wallet.sdk.api.VerifiableCredentialsArray
import dev.trustbloc.wallet.sdk.display.*

val vcArray = VerifiableCredentialsArray()

vcArray.add(yourVCHere)

val resolveOpts = ResolveOpts(vcCredentials, "Issuer_URI_Goes_Here")

val displayData = Display.resolve(resolveOpts)

Kotlin (After)

import dev.trustbloc.wallet.sdk.display.*
import dev.trustbloc.wallet.sdk.verifiable.CredentialsArray

val vcArray = CredentialsArray()
vcArray.add(yourVCHere)

val displayData = Display.resolve(vcArray, "Issuer_URI_Goes_Here", null)

Swift (Before)

import Walletsdk

let vcArray = ApiVerifiableCredentialsArray()

vcArray.add(yourVCHere)

let resolveOpts = DisplayNewResolveOpts(vcArray, "Issuer_URI_Goes_Here")

var error: NSError?
let displayData = DisplayResolve(vcArray, "Issuer_URI_Goes_Here", &error)

Swift (After)

import Walletsdk

let vcArray = VerifiableCredentialsArray()

vcArray.add(yourVCHere)

var error: NSError?
let displayData = DisplayResolve(vcArray, "Issuer_URI_Goes_Here", nil, &error)

OpenID4VP

Kotlin (Before)

import dev.trustbloc.wallet.sdk.localkms.Localkms
import dev.trustbloc.wallet.sdk.localkms.MemKMSStore
import dev.trustbloc.wallet.sdk.did.Resolver
import dev.trustbloc.wallet.sdk.did.Creator
import dev.trustbloc.wallet.sdk.ld.DocLoader
import dev.trustbloc.wallet.sdk.localkms
import dev.trustbloc.wallet.sdk.openid4vp
import dev.trustbloc.wallet.sdk.ld
import dev.trustbloc.wallet.sdk.credential
import dev.trustbloc.wallet.sdk.openid4vp.ClientConfig
import dev.trustbloc.wallet.sdk.openid4vp.Interaction

// Setup
val memKMSStore = MemKMSStore.MemKMSStore()
val kms = Localkms.newKMS(memKMSStore)
val didResolver = Resolver("")
val didCreator = Creator(kms as KeyWriter)
val documentLoader = DocLoader()
val cfg = ClientConfig(kms, kms.getCrypto(), didResolver, documentLoader, null)

// Going through the flow
val interaction = openid4vp.Interaction("YourAuthRequestURIHere", cfg)
val query = interaction.getQuery()
val inquirer = credential.Inquirer(docLoader)
val savedCredentials = api.VerifiableCredentialsArray() // Would need some actual credentials for this to actually work

// Use this code to display the list of VCs to select which of them to send.
val matchedRequirements = inquirer.getSubmissionRequirements(query, savedCredentials) 
val matchedRequirement = matchedRequirements.atIndex(0) // Usually we will have one requirement
val requirementDesc = matchedRequirement.descriptorAtIndex(0) // Usually requirement will contain one descriptor
val selectedVCs = api.VerifiableCredentialsArray()
selectedVCs.add(requirementDesc.matchedVCs.atIndex(0)) // Users should select one VC for each descriptor from the matched list and confirm that they want to share it

interaction.presentCredential(selectedVCs)

Kotlin (After)

import dev.trustbloc.wallet.sdk.localkms.Localkms
import dev.trustbloc.wallet.sdk.localkms.MemKMSStore
import dev.trustbloc.wallet.sdk.did.Resolver
import dev.trustbloc.wallet.sdk.did.Creator
import dev.trustbloc.wallet.sdk.localkms
import dev.trustbloc.wallet.sdk.openid4vp.*
import dev.trustbloc.wallet.sdk.credential.*
import dev.trustbloc.wallet.sdk.verifiable.CredentialsArray

// Setup
val memKMSStore = MemKMSStore.MemKMSStore()
val kms = Localkms.newKMS(memKMSStore)
val didResolver = Resolver(null)

val args = Args("YourAuthRequestURIHere", kms.getCrypto(), didResolver)

// Going through the flow
val interaction = Interaction(args, null)
val query = interaction.getQuery()
val inquirer = Inquirer(null)
val savedCredentials = CredentialsArray() // Would need some actual credentials for this to work

// Use this code to display the list of VCs to select which of them to send.
val matchedRequirements = inquirer.getSubmissionRequirements(query, savedCredentials) 
val matchedRequirement = matchedRequirements.atIndex(0) // Usually we will have one requirement
val requirementDesc = matchedRequirement.descriptorAtIndex(0) // Usually requirement will contain one descriptor
val selectedVCs = CredentialsArray()
selectedVCs.add(requirementDesc.matchedVCs.atIndex(0)) // Users should select one VC for each descriptor from the matched list and confirm that they want to share it

interaction.presentCredential(selectedVCs)

Swift (Before)

import Walletsdk

// Setup
let memKMSStore = LocalkmsNewMemKMSStore()

var error: NSError?
let kms = LocalkmsNewKMS(memKMSStore, &error)

let didResolver = DidNewResolver("", nil)
let documentLoader = LdNewDocLoader()
let clientConfig = Openid4vpClientConfig(keyHandleReader: kms, crypto: kms.getCrypto(), didResolver: didResolver, ldDocumentLoader: documentLoader, activityLogger: nil)

// Going through the flow
var newInteractionError: NSError?
let interaction = Openid4vpInteraction("YourAuthRequestURIHere", config: clientConfig, &newInteractionError)
let query = interaction.getQuery()
let inquirer = CredentialNewInquirer(docLoader)
let savedCredentials = ApiVerifiableCredentialsArray() // Would need some actual credentials for this to actually work

// Use this code to display the list of VCs to select which of them to send.
let matchedRequirements = inquirer.getSubmissionRequirements(query, savedCredentials) 
let matchedRequirement = matchedRequirements.atIndex(0) // Usually we will have one requirement
let requirementDesc = matchedRequirement.descriptorAtIndex(0) // Usually requirement will contain one descriptor
let selectedVCs = ApiVerifiableCredentialsArray()
selectedVCs.add(requirementDesc.matchedVCs.atIndex(0)) // Users should select one VC for each descriptor from the matched list and confirm that they want to share it

let credentials = interaction.presentCredential(selectedVCs)

Swift (After)

import Walletsdk

// Setup
let memKMSStore = LocalkmsNewMemKMSStore()

var error: NSError?
let kms = LocalkmsNewKMS(memKMSStore, &error)

let didResolver = DidNewResolver(nil)

let args = Openid4vpNewArgs("YourAuthRequestURIHere", kms.getCrypto(), didResolver)

// Going through the flow
var newInteractionError: NSError?
let interaction = Openid4vpNewInteraction(args, nil, &newInteractionError)
let query = interaction.getQuery()
let inquirer = CredentialNewInquirer(nil)
let savedCredentials = VerifiableCredentialsArray() // Would need some actual credentials for this to work

// Use this code to display the list of VCs to select which of them to send.
let matchedRequirements = inquirer.getSubmissionRequirements(query, savedCredentials) 
let matchedRequirement = matchedRequirements.atIndex(0) // Usually we will have one requirement
let requirementDesc = matchedRequirement.descriptorAtIndex(0) // Usually requirement will contain one descriptor
let selectedVCs = VerifiableCredentialsArray()
selectedVCs.add(requirementDesc.matchedVCs.atIndex(0)) // Users should select one VC for each descriptor from the matched list and confirm that they want to share it

let credentials = interaction.presentCredential(selectedVCs)

What's Changed

  • fix(app): Show the didDoc data in the didtab by @talwinder50 in #355
  • feat(sdk): Injectable LD document loader, better test stability by @DRK3 in #354
  • feat(sdk): add support of json-ld to ci flow. by @vkubiv in #351
  • feat(sdk): add support of json-ld to vp flow. by @vkubiv in #359
  • fix(app): Add status api ui change by @talwinder50 in #360
  • chore(sdk): update vc status client to latest version by @Moopli in #361
  • fix(sdk): DID Well-Known config validate by @rolsonquadras in #362
  • fix(app): Implement the well known did config change issuance change by @talwinder50 in #363
  • feat(sdk)!: Improved gomobile API parameter design by @DRK3 in #358
  • feat(sdk): support of open telemetry. by @vkubiv in #364
  • fix(app): Add a qr code simulator if the device is not real by @talwinder50 in #368
  • docs(sdk): Add more opts examples by @DRK3 in #367
  • test(app): log healthcheck http reponse code by @rolsonquadras in #370
  • fix(sdk)!: Removed the ToMobileError function from mobile bindings by @DRK3 in #371
  • test(app): flutter test - increase startup sleep time by @rolsonquadras in #372
  • feat(sdk)!: Remove unused arg from OpenID4VP interaction by @DRK3 in #365
  • feat(sdk)!: Improved VC naming in bindings by @DRK3 in #373
  • fix(app): Remove additional padding from the details tab by @talwinder50 in #376
  • docs(sdk): credential status docs by @Moopli in #374
  • feat(sdk)!: Improve names in credential package in generated bindings by @DRK3 in #378
  • feat(sdk): Remove unused files, corrections to docs by @DRK3 in #379
  • feat(sdk)!: enable open telemetry by default. by @vkubiv in #381
  • fix(sdk)!: In-memory credential DB Java constructor by @DRK3 in #375
  • test(app): Add orb docker dep on mongodb by @rolsonquadras in #377
  • feat(sdk): Allow Opts methods to be chained together by @DRK3 in #383
  • fix(app): Add support for did key selection in the settings by @talwinder50 in #380
  • fix(app): Add delete icon notification for deleting credentials by @talwinder50 in #384
  • fix(app): Fix key type selection issue in the settings page by @talwinder50 in #385
  • feat(sdk): verifier display data. by @vkubiv in #388
  • feat(sdk)!: Support for configurable HTTP timeout by @DRK3 in #386
  • fix(sdk)!: VerifierDisplayData method skipped in mobile bindings by @DRK3 in #389
  • chore(sdk): AFG update to v0.2.0 by @rolsonquadras in #390
  • docs(sdk): Corrections to some usage examples by @DRK3 in #391
  • fix(app): Add verifier Display data changes in the app by @talwinder50 in #392
  • docs(sdk): usage example of verifier display data. by @vkubiv in #393
  • fix(sdk): DID WellKnown Config validation - set index instead of 0 by @rolsonquadras in #394
  • refactor(app): set did-ion and ed25519 key as default by @rolsonquadras in #395
  • docs(sdk): Network operations by @DRK3 in #396

Full Changelog: 1.0.0-rc3...1.0.0-rc4