Skip to content

v0.12.2

Compare
Choose a tag to compare
@phisakel phisakel released this 11 Jun 07:05
· 9 commits to main since this release
20f0a0d

v0.12.2

Modified issueDocumentsByOfferUrl method

   /// Issue documents by offer URI.
   /// - Parameters:
   ///   - offerUri: url with offer
   ///   - docTypes: offered doc models available to be issued. Contains key options (secure are name and other options)
   ///   - txCodeValue: Transaction code given to user (if available)
   ///   - promptMessage: prompt message for biometric authentication (optional)
   /// - Returns: Array of issued and stored documents
   public func issueDocumentsByOfferUrl(offerUri: String, docTypes: [OfferedDocModel], txCodeValue: String? = nil, promptMessage: String? = nil) async throws -> [WalletStorage.Document] {

Example usage:

// When resolving an offer, key options are now included
let offer = try await wallet.resolveOfferUrlDocTypes(uriOffer: offerUrl)
for docModel in offer.docModels {
  // use recommended key options or modify them
   let docTypes = offer.docModels.map { $0.copy(keyOptions: KeyOptions(credentialPolicy: .oneTimeUse, batchSize: 2))
   // Issue with optimal settings
   let newDocs = try await wallet.issueDocumentsByOfferUrl(offerUri: offerUrl, docTypes: docTypes, txCodeValue: txCode)
}

OfferedDocModel struct enhancements

Added properties:

  • identifier: String? - Issuer configuration identifier for the credential
  • keyOptions: KeyOptions - Default key options (batch size and credential policy) recommended by the issuer

Updated computed property:

  • docTypeOrVctOrScope renamed to docTypeOrVctOrScope - Now returns docType, vct, or scope in priority order