Releases: eu-digital-identity-wallet/eudi-lib-ios-wallet-kit
v0.12.4
EudiWallet
property addition
- Added
verifierRedirectUri: String?
property toEudiWallet
.- This property stores the OpenID4VP verifier redirect URI, used for redirectUri clients in OpenID4VP flows.
Fix to delete one-time credentials for presented documents only
- Updated the logic to ensure that only one-time credentials for documents that have been presented are deleted.
Fix to issueDocumentsByOfferUrl
crash
- When multiple documents were issued many times the 'Fatal error: Unexpectedly found nil while unwrapping an Optional value' occurred.
v0.12.3
v0.12.2
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 credentialkeyOptions: KeyOptions
- Default key options (batch size and credential policy) recommended by the issuer
Updated computed property:
docTypeOrVctOrScope
renamed todocTypeOrVctOrScope
- Now returns docType, vct, or scope in priority order
v0.12.1
v0.12.1
EudiWallet
added method:
public func getCredentialsUsageCount(id: String) async throws -> CredentialsUsageCounts?
Gets a document's remaining credentials, available for presentation count
This method retrieves usage count information for a specific document based on its credential policy.
For documents issued with a one-time use policy, it returns the number of remaining presentations
available. For documents with a rotate-use policy, it returns nil as there's no usage limit.
if let usageCounts = try await wallet.getCredentialsUsageCount(id: documentId) {
print("Remaining presentations: \(usageCounts.remaining) out of \(usageCounts.total)")
} else {
print("Document has unlimited presentations (rotate-use policy)")
}
EudiWallet
added method:
public func getDefaultKeyOptions(_ docType: String?, scope: String?, identifier: String?) async throws -> KeyOptions
Get default key options (batch-size and credential policy) for a document type from the issuer.
This method queries the issuer to retrieve the recommended key configuration for a specific document type,
scope, or identifier. The returned KeyOptions can be used when issuing documents.
let keyOptions = try await wallet.getDefaultKeyOptions(docType, scope: scope, identifier: identifier)
let document = try await wallet.issueDocument(docType: docType, scope: scope, identifier: identifier, keyOptions: keyOptions)
OfferedDocModel
struct enhancement
Added defaultKeyOptions
property to the OfferedDocModel
struct. This property contains the default key options (batch size and credential policy) recommended by the issuer for the specific credential configuration. When processing credential offers, this property provides the key settings without requiring a separate call to getDefaultKeyOptions
.
// When resolving an offer, defaultKeyOptions are now included
let offer = try await wallet.resolveOfferUrlDocTypes(uriOffer: offerUrl)
for docModel in offer.docModels {
// Use the issuer's recommended key options
let keyOptions = docModel.defaultKeyOptions
}
EudiWallet
removed method:
getRemainingCredentialsCount
v0.12.0
v0.12.0
Batch issuance support
To issue multiple credentials for a document, specify the keyOptions
parameter in the issueDocument
method. This allows to set the credentialPolicy
and batchSize
options.
Example usage:
try await wallet.issueDocument(docType: nil, scope: nil, identifier: identifier, keyOptions: KeyOptions(credentialPolicy: .oneTimeUse, batchSize: 10))
Additional method
/// Get the remaining presentations count for a document.
/// Returns: Remaining presentations count (if one-time use policy was used to issue the document, otherwise nil)
public func getRemainingCredentialsCount(id: String) async throws -> Int?
SecureArea Protocol: Batch-Oriented API Changes
The SecureArea
protocol was refactored to support batch-oriented key management and cryptographic operations. This change introduces methods for handling multiple keys at once. This affects implementors of the SecureArea
protocol.
1. Batch Operations Added
-
Key Creation:
createKeyBatch(id: String, keyOptions: KeyOptions?) async throws -> [CoseKey]
- Creates a batch of keys and returns their public keys.
-
Key Deletion:
deleteKeyBatch(id: String, startIndex: Int, batchSize: Int) async throws
- Deletes a batch of keys starting from a specific index.
deleteKeyInfo(id: String) async throws
- Deletes key metadata for a given batch.
-
Signature and Key Agreement:
signature(id: String, index: Int, algorithm: SigningAlgorithm, dataToSign: Data, unlockData: Data?) async throws -> Data
- Computes a signature using a specific key in the batch.
keyAgreement(id: String, index: Int, publicKey: CoseKey, unlockData: Data?) async throws -> SharedSecret
- Performs key agreement with a specific key in the batch.
-
Key Info:
getKeyBatchInfo(id: String) async throws -> KeyBatchInfo
- Returns information about a batch of keys.
-
Default Algorithm:
defaultSigningAlgorithm(ecCurve: CoseEcCurve) -> SigningAlgorithm
- Returns the default signing algorithm for a given curve.
2. Single-Key Methods Removed
- Single-key methods
createKey
,deleteKey
, andgetKeyInfo
were removed.