Skip to content

Commit

Permalink
Add support for trust anchor registry
Browse files Browse the repository at this point in the history
  • Loading branch information
sbihel committed Aug 30, 2024
1 parent 095bccf commit fb8607a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sources/MobileSdk/MDocBLEUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protocol MDocBLEDelegate: AnyObject {
}

enum MDocReaderBLECallback {
case done([String: [String: [String: MDocItem]]])
case done([String: [String: MDocItem]])
case connected
case error(MdocReaderBleError)
case message(Data)
Expand Down
8 changes: 4 additions & 4 deletions Sources/MobileSdk/MDocReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ public class MDocReader {
var bleManager: MDocReaderBLEPeripheral!
var callback: BLEReaderSessionStateDelegate

public init?(callback: BLEReaderSessionStateDelegate, uri: String, requestedItems: [String: [String: Bool]]) {
public init?(callback: BLEReaderSessionStateDelegate, uri: String, requestedItems: [String: [String: Bool]], trustAnchorRegistry: [String]?) {
self.callback = callback
do {
let sessionData = try SpruceIDMobileSdkRs.establishSession(uri: uri, requestedItems: requestedItems, trustAnchorRegistry: nil)
let sessionData = try SpruceIDMobileSdkRs.establishSession(uri: uri, requestedItems: requestedItems, trustAnchorRegistry: trustAnchorRegistry)
self.sessionManager = sessionData.state
self.bleManager = MDocReaderBLEPeripheral(callback: self, serviceUuid: CBUUID(string: sessionData.uuid), request: sessionData.request, bleIdent: Data(sessionData.bleIdent.utf8))
self.bleManager = MDocReaderBLEPeripheral(callback: self, serviceUuid: CBUUID(string: sessionData.uuid), request: sessionData.request, bleIdent: sessionData.bleIdent)
} catch {
print("\(error)")
return nil
Expand Down Expand Up @@ -65,7 +65,7 @@ public enum BLEReaderSessionState {
/// - 0: The number of chunks received to far
case downloadProgress(Int)
/// App should display a success message and offer to close the page
case success([String: [String: [String: MDocItem]]])
case success([String: [String: MDocItem]])
}

public enum BleReaderSessionError {
Expand Down

0 comments on commit fb8607a

Please sign in to comment.