@velocitycareerlabs/vcl-react-native 2.6.4 → 2.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/android/build.gradle
CHANGED
|
@@ -92,7 +92,7 @@ dependencies {
|
|
|
92
92
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
93
93
|
|
|
94
94
|
//--------- Must: be added:
|
|
95
|
-
implementation "io.velocitycareerlabs:vcl:2.6.
|
|
95
|
+
implementation "io.velocitycareerlabs:vcl:2.6.6"
|
|
96
96
|
implementation 'com.nimbusds:nimbus-jose-jwt:9.41.2'
|
|
97
97
|
implementation "androidx.security:security-crypto:1.1.0-alpha06"
|
|
98
98
|
//-------------------------
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
import Foundation
|
|
12
12
|
|
|
13
13
|
extension String {
|
|
14
|
-
func toDictionary() -> [String:
|
|
14
|
+
func toDictionary() -> [String: Any]? {
|
|
15
15
|
if let data = self.data(using: .utf8) {
|
|
16
16
|
do {
|
|
17
|
-
return try JSONSerialization.jsonObject(with: data, options: []) as? [String:
|
|
17
|
+
return try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any]
|
|
18
18
|
} catch {
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -12,7 +12,7 @@ import Foundation
|
|
|
12
12
|
import VCL
|
|
13
13
|
|
|
14
14
|
func dictionaryToInitializationDescriptor(
|
|
15
|
-
_ initializationDescriptorDictionary: [String:
|
|
15
|
+
_ initializationDescriptorDictionary: [String: Any]
|
|
16
16
|
) -> VCLInitializationDescriptor {
|
|
17
17
|
return VCLInitializationDescriptor(
|
|
18
18
|
environment: dictionaryToEnvironment(
|
|
@@ -24,7 +24,7 @@ func dictionaryToInitializationDescriptor(
|
|
|
24
24
|
cacheSequence: initializationDescriptorDictionary["cacheSequence"] as? Int ?? 0,
|
|
25
25
|
isDebugOn: initializationDescriptorDictionary["isDebugOn"] as? Bool ?? false,
|
|
26
26
|
cryptoServicesDescriptor: dictionaryToCryptoServicesDescriptor(
|
|
27
|
-
initializationDescriptorDictionary["cryptoServicesDescriptor"] as? [String :
|
|
27
|
+
initializationDescriptorDictionary["cryptoServicesDescriptor"] as? [String : Any]
|
|
28
28
|
),
|
|
29
29
|
isDirectIssuerCheckOn: initializationDescriptorDictionary["isDirectIssuerCheckOn"] as? Bool ?? true
|
|
30
30
|
)
|
|
@@ -37,15 +37,15 @@ private func dictionaryToEnvironment(
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
private func dictionaryToCryptoServicesDescriptor(
|
|
40
|
-
_ cryptoServicesDescriptorDictionary: [String:
|
|
40
|
+
_ cryptoServicesDescriptorDictionary: [String: Any]?
|
|
41
41
|
) -> VCLCryptoServicesDescriptor {
|
|
42
42
|
let cryptoServiceType =
|
|
43
43
|
VCLCryptoServiceType.fromString(
|
|
44
44
|
value: cryptoServicesDescriptorDictionary?["cryptoServiceType"] as? String ?? ""
|
|
45
45
|
)
|
|
46
|
-
let remoteCryptoServicesUrlsDescriptorDictionary = cryptoServicesDescriptorDictionary?["remoteCryptoServicesUrlsDescriptor"] as? [String:
|
|
47
|
-
let keyServiceUrls = remoteCryptoServicesUrlsDescriptorDictionary?["keyServiceUrls"] as? [String:
|
|
48
|
-
let jwtServiceUrls = remoteCryptoServicesUrlsDescriptorDictionary?["jwtServiceUrls"] as? [String:
|
|
46
|
+
let remoteCryptoServicesUrlsDescriptorDictionary = cryptoServicesDescriptorDictionary?["remoteCryptoServicesUrlsDescriptor"] as? [String: Any]
|
|
47
|
+
let keyServiceUrls = remoteCryptoServicesUrlsDescriptorDictionary?["keyServiceUrls"] as? [String: Any]
|
|
48
|
+
let jwtServiceUrls = remoteCryptoServicesUrlsDescriptorDictionary?["jwtServiceUrls"] as? [String: Any]
|
|
49
49
|
let remoteCryptoServicesUrlsDescriptor = VCLRemoteCryptoServicesUrlsDescriptor(
|
|
50
50
|
keyServiceUrls: VCLKeyServiceUrls(
|
|
51
51
|
createDidKeyServiceUrl: keyServiceUrls?["createDidKeyServiceUrl"] as? String ?? ""
|
|
@@ -69,8 +69,8 @@ private func dictionaryToXVnfProtocolVersion(
|
|
|
69
69
|
|
|
70
70
|
func regionToDictionary(
|
|
71
71
|
_ region: VCLRegion
|
|
72
|
-
) -> [String:
|
|
73
|
-
var regionDict = [String:
|
|
72
|
+
) -> [String: Any] {
|
|
73
|
+
var regionDict = [String: Any]()
|
|
74
74
|
regionDict["payload"] = region.payload
|
|
75
75
|
regionDict["code"] = region.code
|
|
76
76
|
regionDict["name"] = region.name
|
|
@@ -79,9 +79,9 @@ func regionToDictionary(
|
|
|
79
79
|
|
|
80
80
|
func regionsToDictionary(
|
|
81
81
|
_ regions: VCLRegions
|
|
82
|
-
) -> [String:
|
|
83
|
-
var regionsMap = [String:
|
|
84
|
-
var regionsArr = [[String:
|
|
82
|
+
) -> [String: Any] {
|
|
83
|
+
var regionsMap = [String: Any]()
|
|
84
|
+
var regionsArr = [[String: Any]]()
|
|
85
85
|
for i in 0..<regions.all.count {
|
|
86
86
|
regionsArr.append(regionToDictionary(regions.all[i]))
|
|
87
87
|
}
|
|
@@ -91,8 +91,8 @@ func regionsToDictionary(
|
|
|
91
91
|
|
|
92
92
|
func countryToDictionary(
|
|
93
93
|
_ country: VCLCountry
|
|
94
|
-
) -> [String:
|
|
95
|
-
var countryDict = [String:
|
|
94
|
+
) -> [String: Any] {
|
|
95
|
+
var countryDict = [String: Any]()
|
|
96
96
|
countryDict["payload"] = country.payload
|
|
97
97
|
countryDict["code"] = country.code
|
|
98
98
|
countryDict["name"] = country.name
|
|
@@ -104,8 +104,8 @@ func countryToDictionary(
|
|
|
104
104
|
|
|
105
105
|
func countriesToDictionary(
|
|
106
106
|
_ countries: VCLCountries
|
|
107
|
-
) -> [String: [[String:
|
|
108
|
-
var countriesArr = [[String:
|
|
107
|
+
) -> [String: [[String: Any]?]] {
|
|
108
|
+
var countriesArr = [[String: Any]?] ()
|
|
109
109
|
if let all = countries.all {
|
|
110
110
|
for i in 0..<all.count {
|
|
111
111
|
countriesArr.append(countryToDictionary(all[i]))
|
|
@@ -116,11 +116,11 @@ func countriesToDictionary(
|
|
|
116
116
|
|
|
117
117
|
func credentialTypeSchemasToDictionary(
|
|
118
118
|
_ credentialTypeSchemas: VCLCredentialTypeSchemas
|
|
119
|
-
) -> [String: [String:
|
|
120
|
-
var credentialTypeSchemasMap = [String: [String:
|
|
119
|
+
) -> [String: [String: Any]] {
|
|
120
|
+
var credentialTypeSchemasMap = [String: [String: Any]]()
|
|
121
121
|
if let all = credentialTypeSchemas.all {
|
|
122
122
|
for (key, credentialTypeSchema) in all {
|
|
123
|
-
var credentialTypeSchemaDictionary = [String:
|
|
123
|
+
var credentialTypeSchemaDictionary = [String: Any]()
|
|
124
124
|
credentialTypeSchemaDictionary["payload"] = credentialTypeSchema.payload
|
|
125
125
|
credentialTypeSchemasMap[key] = credentialTypeSchemaDictionary
|
|
126
126
|
}
|
|
@@ -130,9 +130,9 @@ func credentialTypeSchemasToDictionary(
|
|
|
130
130
|
|
|
131
131
|
func credentialTypesToDictionary(
|
|
132
132
|
_ credentialTypes: VCLCredentialTypes
|
|
133
|
-
) -> [String: [[String:
|
|
134
|
-
var credentialTypesArray = [[String:
|
|
135
|
-
var recommendedCredentialTypesArray = [[String:
|
|
133
|
+
) -> [String: [[String: Any?]]] {
|
|
134
|
+
var credentialTypesArray = [[String: Any?]]()
|
|
135
|
+
var recommendedCredentialTypesArray = [[String: Any?]]()
|
|
136
136
|
if let all = credentialTypes.all {
|
|
137
137
|
credentialTypesArray = parseCredentialTypesArray(all)
|
|
138
138
|
}
|
|
@@ -142,10 +142,10 @@ func credentialTypesToDictionary(
|
|
|
142
142
|
return ["all": credentialTypesArray, "recommendedTypes": recommendedCredentialTypesArray]
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
private func parseCredentialTypesArray(_ credentialTypesArr: [VCLCredentialType]) -> [[String:
|
|
146
|
-
var credentialTypesArray = [[String:
|
|
145
|
+
private func parseCredentialTypesArray(_ credentialTypesArr: [VCLCredentialType]) -> [[String: Any?]] {
|
|
146
|
+
var credentialTypesArray = [[String: Any?]]()
|
|
147
147
|
credentialTypesArr.forEach {
|
|
148
|
-
var credentialType = [String:
|
|
148
|
+
var credentialType = [String: Any?]()
|
|
149
149
|
credentialType["payload"] = $0.payload
|
|
150
150
|
credentialType["id"] = $0.id
|
|
151
151
|
credentialType["schema"] = $0.schema
|
|
@@ -161,38 +161,38 @@ private func parseCredentialTypesArray(_ credentialTypesArr: [VCLCredentialType]
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
func dictionaryTopPresentationRequestDescriptor(
|
|
164
|
-
_ presentationRequestDescriptorLinkDictionary: [String:
|
|
164
|
+
_ presentationRequestDescriptorLinkDictionary: [String: Any]
|
|
165
165
|
) -> VCLPresentationRequestDescriptor {
|
|
166
166
|
return VCLPresentationRequestDescriptor(
|
|
167
|
-
deepLink: dictionaryToDeepLink(presentationRequestDescriptorLinkDictionary["deepLink"] as? [String:
|
|
168
|
-
pushDelegate: dictionaryToPushDelegate(presentationRequestDescriptorLinkDictionary["pushDelegate"] as? [String:
|
|
169
|
-
didJwk: dictionaryToDidJwk(presentationRequestDescriptorLinkDictionary["didJwk"] as? [String:
|
|
167
|
+
deepLink: dictionaryToDeepLink(presentationRequestDescriptorLinkDictionary["deepLink"] as? [String: Any]) ?? VCLDeepLink(value: ""),
|
|
168
|
+
pushDelegate: dictionaryToPushDelegate(presentationRequestDescriptorLinkDictionary["pushDelegate"] as? [String: Any]),
|
|
169
|
+
didJwk: dictionaryToDidJwk(presentationRequestDescriptorLinkDictionary["didJwk"] as? [String: Any]),
|
|
170
170
|
remoteCryptoServicesToken: dictionaryToToken(
|
|
171
|
-
presentationRequestDescriptorLinkDictionary["remoteCryptoServicesToken"] as? [String:
|
|
171
|
+
presentationRequestDescriptorLinkDictionary["remoteCryptoServicesToken"] as? [String: Any]
|
|
172
172
|
)
|
|
173
173
|
)
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
func dictionaryToDeepLink(_ deepLinkDictionary: [String:
|
|
176
|
+
func dictionaryToDeepLink(_ deepLinkDictionary: [String: Any]?) -> VCLDeepLink? {
|
|
177
177
|
if let value = deepLinkDictionary?["value"] as? String {
|
|
178
178
|
return VCLDeepLink(value: value)
|
|
179
179
|
}
|
|
180
180
|
return nil
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
func deepLinkToDictionary(_ deepLink: VCLDeepLink?) -> [String:
|
|
183
|
+
func deepLinkToDictionary(_ deepLink: VCLDeepLink?) -> [String: Any]? {
|
|
184
184
|
if let value = deepLink?.value {
|
|
185
185
|
return ["value": value]
|
|
186
186
|
}
|
|
187
187
|
return nil
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
func dictionaryToToken(_ tokenDictionary: [String:
|
|
190
|
+
func dictionaryToToken(_ tokenDictionary: [String: Any]?) -> VCLToken {
|
|
191
191
|
return VCLToken(value: tokenDictionary?["value"] as? String ?? "")
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
func tokenToDictionary(_ token: VCLToken?) -> [String:
|
|
195
|
-
var retVal = [String:
|
|
194
|
+
func tokenToDictionary(_ token: VCLToken?) -> [String: Any] {
|
|
195
|
+
var retVal = [String: Any]()
|
|
196
196
|
retVal["value"] = token?.value
|
|
197
197
|
if let expiresIn = token?.expiresIn {
|
|
198
198
|
retVal["expiresIn"] = expiresIn
|
|
@@ -201,7 +201,7 @@ func tokenToDictionary(_ token: VCLToken?) -> [String: Sendable] {
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
func dictionaryToIssuingType(
|
|
204
|
-
issuingTypeDictionary: [String:
|
|
204
|
+
issuingTypeDictionary: [String: Any],
|
|
205
205
|
defaultIssuingType: VCLIssuingType
|
|
206
206
|
) -> VCLIssuingType {
|
|
207
207
|
if let issuingType = issuingTypeDictionary["issuingType"] as? String {
|
|
@@ -211,22 +211,22 @@ func dictionaryToIssuingType(
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
func dictionaryToPresentationRequest(
|
|
214
|
-
_ presentationRequestDictionary: [String:
|
|
214
|
+
_ presentationRequestDictionary: [String: Any]?
|
|
215
215
|
) -> VCLPresentationRequest {
|
|
216
216
|
return VCLPresentationRequest(
|
|
217
|
-
jwt: dictionaryToJwt(presentationRequestDictionary?["jwt"] as? [String :
|
|
218
|
-
verifiedProfile: dictionaryToVerifiedProfile(presentationRequestDictionary?["verifiedProfile"] as? [String:
|
|
219
|
-
deepLink: dictionaryToDeepLink(presentationRequestDictionary?["deepLink"] as? [String :
|
|
220
|
-
pushDelegate: dictionaryToPushDelegate(presentationRequestDictionary?["pushDelegate"] as? [String :
|
|
221
|
-
didJwk: dictionaryToDidJwk(presentationRequestDictionary?["didJwk"] as? [String :
|
|
222
|
-
remoteCryptoServicesToken: dictionaryToToken(presentationRequestDictionary?["remoteCryptoServicesToken"] as? [String :
|
|
217
|
+
jwt: dictionaryToJwt(presentationRequestDictionary?["jwt"] as? [String : Any]),
|
|
218
|
+
verifiedProfile: dictionaryToVerifiedProfile(presentationRequestDictionary?["verifiedProfile"] as? [String: Any]),
|
|
219
|
+
deepLink: dictionaryToDeepLink(presentationRequestDictionary?["deepLink"] as? [String : Any]) ?? VCLDeepLink(value: ""),
|
|
220
|
+
pushDelegate: dictionaryToPushDelegate(presentationRequestDictionary?["pushDelegate"] as? [String : Any]),
|
|
221
|
+
didJwk: dictionaryToDidJwk(presentationRequestDictionary?["didJwk"] as? [String : Any]),
|
|
222
|
+
remoteCryptoServicesToken: dictionaryToToken(presentationRequestDictionary?["remoteCryptoServicesToken"] as? [String : Any])
|
|
223
223
|
)
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
func presentationRequestToDictionary(
|
|
227
227
|
_ presentationRequest: VCLPresentationRequest
|
|
228
|
-
) -> [String:
|
|
229
|
-
var presentationRequestDictionary = [String:
|
|
228
|
+
) -> [String: Any] {
|
|
229
|
+
var presentationRequestDictionary = [String: Any]()
|
|
230
230
|
presentationRequestDictionary["jwt"] = ["encodedJwt": presentationRequest.jwt.encodedJwt]
|
|
231
231
|
presentationRequestDictionary["verifiedProfile"] = verifiedProfileToDictionary(presentationRequest.verifiedProfile)
|
|
232
232
|
presentationRequestDictionary["iss"] = presentationRequest.iss
|
|
@@ -239,7 +239,7 @@ func presentationRequestToDictionary(
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
func dictionaryToPresentationSubmission(
|
|
242
|
-
_ presentationSubmissionDictionary: [String:
|
|
242
|
+
_ presentationSubmissionDictionary: [String: Any]?
|
|
243
243
|
) -> VCLPresentationSubmission {
|
|
244
244
|
var verifiableCredentialsList = [VCLVerifiableCredential]()
|
|
245
245
|
if let verifiableCredentialsArr = (presentationSubmissionDictionary?["verifiableCredentials"] as? [[String: String]]) {
|
|
@@ -253,15 +253,15 @@ func dictionaryToPresentationSubmission(
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
return VCLPresentationSubmission(
|
|
256
|
-
presentationRequest: dictionaryToPresentationRequest(presentationSubmissionDictionary?["presentationRequest"] as? [String:
|
|
256
|
+
presentationRequest: dictionaryToPresentationRequest(presentationSubmissionDictionary?["presentationRequest"] as? [String: Any]),
|
|
257
257
|
verifiableCredentials: verifiableCredentialsList
|
|
258
258
|
)
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
func presentationSubmissionResultToDictionary(
|
|
262
262
|
_ presentationSubmissionResult: VCLSubmissionResult
|
|
263
|
-
) -> [String:
|
|
264
|
-
var presentationSubmissionResulDictionary = [String:
|
|
263
|
+
) -> [String: Any] {
|
|
264
|
+
var presentationSubmissionResulDictionary = [String: Any]()
|
|
265
265
|
presentationSubmissionResulDictionary[VCLSubmissionResult.CodingKeys.KeyToken] = tokenToDictionary(presentationSubmissionResult.sessionToken)
|
|
266
266
|
presentationSubmissionResulDictionary[VCLSubmissionResult.CodingKeys.KeyExchange] = exchangeToDictionary(presentationSubmissionResult.exchange)
|
|
267
267
|
presentationSubmissionResulDictionary[VCLSubmissionResult.CodingKeys.KeyJti] = presentationSubmissionResult.jti
|
|
@@ -271,8 +271,8 @@ func presentationSubmissionResultToDictionary(
|
|
|
271
271
|
|
|
272
272
|
func exchangeToDictionary(
|
|
273
273
|
_ exchange: VCLExchange?
|
|
274
|
-
) -> [String:
|
|
275
|
-
var exchangeDictionary = [String:
|
|
274
|
+
) -> [String: Any] {
|
|
275
|
+
var exchangeDictionary = [String: Any]()
|
|
276
276
|
exchangeDictionary["id"] = exchange?.id
|
|
277
277
|
exchangeDictionary["type"] = exchange?.type
|
|
278
278
|
exchangeDictionary["disclosureComplete"] = exchange?.disclosureComplete
|
|
@@ -280,17 +280,17 @@ func exchangeToDictionary(
|
|
|
280
280
|
return exchangeDictionary
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
func dictionaryToSubmissionResult(_ submissionResultDictionary: [String:
|
|
283
|
+
func dictionaryToSubmissionResult(_ submissionResultDictionary: [String: Any]?) -> VCLSubmissionResult {
|
|
284
284
|
return VCLSubmissionResult(
|
|
285
|
-
sessionToken: dictionaryToToken(submissionResultDictionary?[VCLSubmissionResult.CodingKeys.KeyToken] as? [String:
|
|
286
|
-
exchange: dictionaryToExchange(submissionResultDictionary?[VCLSubmissionResult.CodingKeys.KeyExchange] as? [String:
|
|
285
|
+
sessionToken: dictionaryToToken(submissionResultDictionary?[VCLSubmissionResult.CodingKeys.KeyToken] as? [String: Any]),
|
|
286
|
+
exchange: dictionaryToExchange(submissionResultDictionary?[VCLSubmissionResult.CodingKeys.KeyExchange] as? [String: Any]),
|
|
287
287
|
jti: submissionResultDictionary?[VCLSubmissionResult.CodingKeys.KeyJti] as? String ?? "",
|
|
288
288
|
submissionId: submissionResultDictionary?[VCLSubmissionResult.CodingKeys.KeySubmissionId] as? String ?? ""
|
|
289
289
|
)
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
func dictionaryToExchange(
|
|
293
|
-
_ exchangeReadableMap: [String:
|
|
293
|
+
_ exchangeReadableMap: [String: Any]?
|
|
294
294
|
) -> VCLExchange {
|
|
295
295
|
return VCLExchange(
|
|
296
296
|
id: exchangeReadableMap?["id"] as? String ?? "",
|
|
@@ -301,27 +301,27 @@ func dictionaryToExchange(
|
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
func dictionaryToExchangeDescriptor(
|
|
304
|
-
_ exchangeDescriptorDictionary: [String:
|
|
304
|
+
_ exchangeDescriptorDictionary: [String: Any]?
|
|
305
305
|
) -> VCLExchangeDescriptor {
|
|
306
306
|
return VCLExchangeDescriptor(
|
|
307
|
-
presentationSubmission: dictionaryToPresentationSubmission(exchangeDescriptorDictionary?["presentationSubmission"] as? [String:
|
|
308
|
-
submissionResult: dictionaryToSubmissionResult(exchangeDescriptorDictionary?["submissionResult"] as? [String:
|
|
307
|
+
presentationSubmission: dictionaryToPresentationSubmission(exchangeDescriptorDictionary?["presentationSubmission"] as? [String: Any]),
|
|
308
|
+
submissionResult: dictionaryToSubmissionResult(exchangeDescriptorDictionary?["submissionResult"] as? [String: Any])
|
|
309
309
|
)
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
func dictionayToOrganizationsSearchDescriptor(
|
|
313
|
-
_ organizationsDescriptorDictionary: [String:
|
|
313
|
+
_ organizationsDescriptorDictionary: [String: Any]
|
|
314
314
|
) -> VCLOrganizationsSearchDescriptor {
|
|
315
315
|
return VCLOrganizationsSearchDescriptor(
|
|
316
|
-
filter: dictionaryToFilter(organizationsDescriptorDictionary["filter"] as? [String :
|
|
317
|
-
page: dictionaryToPage(organizationsDescriptorDictionary["page"] as? [String :
|
|
316
|
+
filter: dictionaryToFilter(organizationsDescriptorDictionary["filter"] as? [String : Any]),
|
|
317
|
+
page: dictionaryToPage(organizationsDescriptorDictionary["page"] as? [String : Any]),
|
|
318
318
|
sort: organizationsDescriptorDictionary["sort"] as? [[String]],
|
|
319
319
|
query: organizationsDescriptorDictionary["query"] as? String
|
|
320
320
|
)
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
func dictionaryToFilter(
|
|
324
|
-
_ filterDictionary: [String:
|
|
324
|
+
_ filterDictionary: [String: Any]?
|
|
325
325
|
) -> VCLFilter {
|
|
326
326
|
let did: String? = filterDictionary?["did"] as? String
|
|
327
327
|
var serviceTypesList: [VCLServiceType]? = nil
|
|
@@ -342,7 +342,7 @@ func dictionaryToFilter(
|
|
|
342
342
|
return VCLFilter(did: did, serviceTypes: serviceTypes, credentialTypes: credentialTypesList)
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
-
func dictionaryToPage(_ pageDictionary: [String:
|
|
345
|
+
func dictionaryToPage(_ pageDictionary: [String: Any]?) -> VCLPage {
|
|
346
346
|
return VCLPage(
|
|
347
347
|
size: pageDictionary?["size"] as? String,
|
|
348
348
|
skip: pageDictionary?["skip"] as? String
|
|
@@ -351,15 +351,15 @@ func dictionaryToPage(_ pageDictionary: [String: Sendable]?) -> VCLPage {
|
|
|
351
351
|
|
|
352
352
|
func organizationsToDictionary(
|
|
353
353
|
_ organizations: VCLOrganizations
|
|
354
|
-
) -> [String:
|
|
355
|
-
var organizationsMap = [String:
|
|
356
|
-
var organizationsArr = [[String:
|
|
354
|
+
) -> [String: Any] {
|
|
355
|
+
var organizationsMap = [String: Any]()
|
|
356
|
+
var organizationsArr = [[String: Any]]()
|
|
357
357
|
organizations.all.forEach { organization in
|
|
358
|
-
var organizationMap = [String:
|
|
358
|
+
var organizationMap = [String: Any]()
|
|
359
359
|
organizationMap["payload"] = organization.payload
|
|
360
|
-
var serviceCredentialAgentIssuersArr = [[String:
|
|
360
|
+
var serviceCredentialAgentIssuersArr = [[String: Any]]()
|
|
361
361
|
organization.serviceCredentialAgentIssuers.forEach { service in
|
|
362
|
-
var serviceCredentialAgentIssuerMap = [String:
|
|
362
|
+
var serviceCredentialAgentIssuerMap = [String: Any]()
|
|
363
363
|
if let credentialTypes = service.credentialTypes {
|
|
364
364
|
serviceCredentialAgentIssuerMap["credentialTypes"] = credentialTypes
|
|
365
365
|
}
|
|
@@ -377,7 +377,7 @@ func organizationsToDictionary(
|
|
|
377
377
|
return organizationsMap
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
-
func dictionaryToPushDelegate(_ pushDelegateMap: [String:
|
|
380
|
+
func dictionaryToPushDelegate(_ pushDelegateMap: [String: Any]?) -> VCLPushDelegate? {
|
|
381
381
|
let pushUrl = pushDelegateMap?["pushUrl"] as? String
|
|
382
382
|
let pushToken = pushDelegateMap?["pushToken"] as? String
|
|
383
383
|
if (pushUrl != nil && pushToken != nil) {
|
|
@@ -390,7 +390,7 @@ func dictionaryToPushDelegate(_ pushDelegateMap: [String: Sendable]?) -> VCLPush
|
|
|
390
390
|
}
|
|
391
391
|
|
|
392
392
|
func dictionaryToCredentialManifestDescriptor(
|
|
393
|
-
_ credentialManifestDescriptorDictionary: [String:
|
|
393
|
+
_ credentialManifestDescriptorDictionary: [String: Any]
|
|
394
394
|
) -> VCLCredentialManifestDescriptor? {
|
|
395
395
|
if (credentialManifestDescriptorDictionary["deepLink"] != nil) {
|
|
396
396
|
return dictionaryToCredentialManifestDescriptorByDeepLink(credentialManifestDescriptorDictionary)
|
|
@@ -405,30 +405,30 @@ func dictionaryToCredentialManifestDescriptor(
|
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
func dictionaryToCredentialManifestDescriptorByDeepLink(
|
|
408
|
-
_ credentialManifestDescriptorByDeepLinkDictionary: [String:
|
|
408
|
+
_ credentialManifestDescriptorByDeepLinkDictionary: [String: Any]
|
|
409
409
|
) -> VCLCredentialManifestDescriptorByDeepLink {
|
|
410
410
|
return VCLCredentialManifestDescriptorByDeepLink(
|
|
411
411
|
deepLink: dictionaryToDeepLink(
|
|
412
|
-
credentialManifestDescriptorByDeepLinkDictionary["deepLink"] as? [String
|
|
412
|
+
credentialManifestDescriptorByDeepLinkDictionary["deepLink"] as? [String: Any]
|
|
413
413
|
) ?? VCLDeepLink(value: ""),
|
|
414
414
|
issuingType: dictionaryToIssuingType(
|
|
415
415
|
issuingTypeDictionary: credentialManifestDescriptorByDeepLinkDictionary,
|
|
416
416
|
defaultIssuingType: VCLIssuingType.Career
|
|
417
417
|
),
|
|
418
|
-
pushDelegate: dictionaryToPushDelegate(credentialManifestDescriptorByDeepLinkDictionary["pushDelegate"] as? [String:
|
|
419
|
-
didJwk: dictionaryToDidJwk(credentialManifestDescriptorByDeepLinkDictionary["didJwk"] as? [String:
|
|
418
|
+
pushDelegate: dictionaryToPushDelegate(credentialManifestDescriptorByDeepLinkDictionary["pushDelegate"] as? [String: Any]),
|
|
419
|
+
didJwk: dictionaryToDidJwk(credentialManifestDescriptorByDeepLinkDictionary["didJwk"] as? [String: Any]),
|
|
420
420
|
remoteCryptoServicesToken: dictionaryToToken(
|
|
421
|
-
credentialManifestDescriptorByDeepLinkDictionary["remoteCryptoServicesToken"] as? [String:
|
|
421
|
+
credentialManifestDescriptorByDeepLinkDictionary["remoteCryptoServicesToken"] as? [String: Any]
|
|
422
422
|
)
|
|
423
423
|
)
|
|
424
424
|
}
|
|
425
425
|
|
|
426
426
|
func dictionaryToCredentialManifestDescriptorByService(
|
|
427
|
-
_ credentialManifestDescriptorByServiceDictionary: [String:
|
|
427
|
+
_ credentialManifestDescriptorByServiceDictionary: [String: Any]
|
|
428
428
|
) -> VCLCredentialManifestDescriptorByService {
|
|
429
429
|
return VCLCredentialManifestDescriptorByService(
|
|
430
430
|
service: dictionaryToService(
|
|
431
|
-
credentialManifestDescriptorByServiceDictionary["service"] as? [String :
|
|
431
|
+
credentialManifestDescriptorByServiceDictionary["service"] as? [String : Any]
|
|
432
432
|
),
|
|
433
433
|
issuingType: dictionaryToIssuingType(
|
|
434
434
|
issuingTypeDictionary: credentialManifestDescriptorByServiceDictionary,
|
|
@@ -436,40 +436,40 @@ func dictionaryToCredentialManifestDescriptorByService(
|
|
|
436
436
|
),
|
|
437
437
|
credentialTypes: credentialManifestDescriptorByServiceDictionary["credentialTypes"] as? [String],
|
|
438
438
|
pushDelegate: dictionaryToPushDelegate(
|
|
439
|
-
credentialManifestDescriptorByServiceDictionary["pushDelegate"] as? [String:
|
|
439
|
+
credentialManifestDescriptorByServiceDictionary["pushDelegate"] as? [String: Any]
|
|
440
440
|
),
|
|
441
|
-
didJwk: dictionaryToDidJwk(credentialManifestDescriptorByServiceDictionary["didJwk"] as? [String:
|
|
441
|
+
didJwk: dictionaryToDidJwk(credentialManifestDescriptorByServiceDictionary["didJwk"] as? [String: Any]),
|
|
442
442
|
remoteCryptoServicesToken: dictionaryToToken(
|
|
443
|
-
credentialManifestDescriptorByServiceDictionary["remoteCryptoServicesToken"] as? [String:
|
|
443
|
+
credentialManifestDescriptorByServiceDictionary["remoteCryptoServicesToken"] as? [String: Any]
|
|
444
444
|
)
|
|
445
445
|
)
|
|
446
446
|
}
|
|
447
447
|
|
|
448
448
|
func dictionaryToCredentialManifestDescriptorRefresh(
|
|
449
|
-
_ credentialManifestDescriptorRefreshDictionary: [String:
|
|
449
|
+
_ credentialManifestDescriptorRefreshDictionary: [String: Any]
|
|
450
450
|
) -> VCLCredentialManifestDescriptorRefresh {
|
|
451
451
|
return VCLCredentialManifestDescriptorRefresh(
|
|
452
452
|
service: dictionaryToService(
|
|
453
|
-
credentialManifestDescriptorRefreshDictionary["service"] as? [String :
|
|
453
|
+
credentialManifestDescriptorRefreshDictionary["service"] as? [String : Any]
|
|
454
454
|
),
|
|
455
455
|
credentialIds: credentialManifestDescriptorRefreshDictionary["credentialIds"] as? [String] ?? [],
|
|
456
|
-
didJwk: dictionaryToDidJwk(credentialManifestDescriptorRefreshDictionary["didJwk"] as? [String:
|
|
456
|
+
didJwk: dictionaryToDidJwk(credentialManifestDescriptorRefreshDictionary["didJwk"] as? [String: Any]),
|
|
457
457
|
remoteCryptoServicesToken: dictionaryToToken(
|
|
458
|
-
credentialManifestDescriptorRefreshDictionary["remoteCryptoServicesToken"] as? [String:
|
|
458
|
+
credentialManifestDescriptorRefreshDictionary["remoteCryptoServicesToken"] as? [String: Any]
|
|
459
459
|
)
|
|
460
460
|
)
|
|
461
461
|
}
|
|
462
462
|
|
|
463
463
|
func dictionaryToService(
|
|
464
|
-
_ serviceDictionary: [String:
|
|
464
|
+
_ serviceDictionary: [String: Any]?
|
|
465
465
|
) -> VCLService {
|
|
466
|
-
return VCLService(payload: serviceDictionary?["payload"] as? [String :
|
|
466
|
+
return VCLService(payload: serviceDictionary?["payload"] as? [String : Any] ?? [:])
|
|
467
467
|
}
|
|
468
468
|
|
|
469
469
|
func credentialManifestToDictionary(
|
|
470
470
|
_ credentialManifest: VCLCredentialManifest
|
|
471
|
-
) -> [String:
|
|
472
|
-
var credentialManifestDictinary = [String:
|
|
471
|
+
) -> [String: Any] {
|
|
472
|
+
var credentialManifestDictinary = [String: Any]()
|
|
473
473
|
credentialManifestDictinary["jwt"] = ["encodedJwt": credentialManifest.jwt.encodedJwt]
|
|
474
474
|
credentialManifestDictinary["did"] = credentialManifest.did
|
|
475
475
|
credentialManifestDictinary["iss"] = credentialManifest.iss
|
|
@@ -483,15 +483,15 @@ func credentialManifestToDictionary(
|
|
|
483
483
|
}
|
|
484
484
|
|
|
485
485
|
func dictionaryToCredentialManifest(
|
|
486
|
-
_ credentialManifestDictionary: [String:
|
|
486
|
+
_ credentialManifestDictionary: [String: Any]?
|
|
487
487
|
) -> VCLCredentialManifest {
|
|
488
|
-
let jwt = VCLJwt(encodedJwt: (credentialManifestDictionary?["jwt"] as? [String:
|
|
488
|
+
let jwt = VCLJwt(encodedJwt: (credentialManifestDictionary?["jwt"] as? [String: Any])?["encodedJwt"] as? String ?? "")
|
|
489
489
|
let vendorOriginContext = credentialManifestDictionary?["vendorOriginContext"] as? String
|
|
490
|
-
let verifiedProfileDictionary = credentialManifestDictionary?["verifiedProfile"] as? [String:
|
|
491
|
-
let deepLink = dictionaryToDeepLink(credentialManifestDictionary?["deepLink"] as? [String:
|
|
492
|
-
let didJwk = dictionaryToDidJwk(credentialManifestDictionary?["didJwk"] as? [String:
|
|
493
|
-
let remoteCryptoServicesToken = dictionaryToToken(credentialManifestDictionary?["remoteCryptoServicesToken"] as? [String:
|
|
494
|
-
|
|
490
|
+
let verifiedProfileDictionary = credentialManifestDictionary?["verifiedProfile"] as? [String: Any]
|
|
491
|
+
let deepLink = dictionaryToDeepLink(credentialManifestDictionary?["deepLink"] as? [String: Any])
|
|
492
|
+
let didJwk = dictionaryToDidJwk(credentialManifestDictionary?["didJwk"] as? [String: Any])
|
|
493
|
+
let remoteCryptoServicesToken = dictionaryToToken(credentialManifestDictionary?["remoteCryptoServicesToken"] as? [String: Any])
|
|
494
|
+
|
|
495
495
|
return VCLCredentialManifest(
|
|
496
496
|
jwt: jwt,
|
|
497
497
|
vendorOriginContext: vendorOriginContext,
|
|
@@ -503,9 +503,9 @@ func dictionaryToCredentialManifest(
|
|
|
503
503
|
}
|
|
504
504
|
|
|
505
505
|
func dictionaryToGenerateOffersDescriptor(
|
|
506
|
-
_ generateOffersDescriptorDictionary: [String:
|
|
506
|
+
_ generateOffersDescriptorDictionary: [String: Any]
|
|
507
507
|
) -> VCLGenerateOffersDescriptor {
|
|
508
|
-
let verifiableCredentialsArr = generateOffersDescriptorDictionary["identificationVerifiableCredentials"] as? [
|
|
508
|
+
let verifiableCredentialsArr = generateOffersDescriptorDictionary["identificationVerifiableCredentials"] as? [Any]
|
|
509
509
|
var verifiableCredentialsList: [VCLVerifiableCredential]? = nil
|
|
510
510
|
if let verifiableCredentials = verifiableCredentialsArr {
|
|
511
511
|
verifiableCredentialsList = [VCLVerifiableCredential]()
|
|
@@ -520,15 +520,15 @@ func dictionaryToGenerateOffersDescriptor(
|
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
522
|
return VCLGenerateOffersDescriptor(
|
|
523
|
-
credentialManifest: dictionaryToCredentialManifest(generateOffersDescriptorDictionary["credentialManifest"] as? [String:
|
|
523
|
+
credentialManifest: dictionaryToCredentialManifest(generateOffersDescriptorDictionary["credentialManifest"] as? [String: Any]),
|
|
524
524
|
types: generateOffersDescriptorDictionary["types"] as? [String],
|
|
525
525
|
offerHashes: generateOffersDescriptorDictionary["offerHashes"] as? [String],
|
|
526
526
|
identificationVerifiableCredentials: verifiableCredentialsList
|
|
527
527
|
)
|
|
528
528
|
}
|
|
529
529
|
|
|
530
|
-
func offersToDictionary(_ offers: VCLOffers) -> [String:
|
|
531
|
-
var offersDictionary = [String:
|
|
530
|
+
func offersToDictionary(_ offers: VCLOffers) -> [String: Any] {
|
|
531
|
+
var offersDictionary = [String: Any]()
|
|
532
532
|
offersDictionary["payload"] = offers.payload
|
|
533
533
|
offersDictionary["all"] = allOffersToArray(offers.all)
|
|
534
534
|
offersDictionary["responseCode"] = offers.responseCode
|
|
@@ -537,23 +537,23 @@ func offersToDictionary(_ offers: VCLOffers) -> [String: Sendable] {
|
|
|
537
537
|
return offersDictionary
|
|
538
538
|
}
|
|
539
539
|
|
|
540
|
-
func dictionaryToOffers(_ offersDictionary: [String :
|
|
540
|
+
func dictionaryToOffers(_ offersDictionary: [String : Any]?) -> VCLOffers {
|
|
541
541
|
return VCLOffers(
|
|
542
|
-
payload: offersDictionary?["payload"] as? [String:
|
|
543
|
-
all: arrayToAllOffers(offersDictionary!["all"] as? [[String :
|
|
542
|
+
payload: offersDictionary?["payload"] as? [String: Any] ?? [String: Any](),
|
|
543
|
+
all: arrayToAllOffers(offersDictionary!["all"] as? [[String : Any]]),
|
|
544
544
|
responseCode: offersDictionary?["responseCode"] as? Int ?? 0,
|
|
545
|
-
sessionToken: dictionaryToToken(offersDictionary?["sessionToken"] as? [String:
|
|
545
|
+
sessionToken: dictionaryToToken(offersDictionary?["sessionToken"] as? [String: Any]),
|
|
546
546
|
challenge: offersDictionary?["challenge"] as? String ?? ""
|
|
547
547
|
)
|
|
548
548
|
}
|
|
549
549
|
|
|
550
|
-
func arrayToAllOffers(_ allOffersArray: [[String :
|
|
550
|
+
func arrayToAllOffers(_ allOffersArray: [[String : Any]]?) -> [VCLOffer] {
|
|
551
551
|
return allOffersArray?.map {
|
|
552
|
-
VCLOffer(payload: $0["payload"] as? [String :
|
|
552
|
+
VCLOffer(payload: $0["payload"] as? [String : Any] ?? [:])
|
|
553
553
|
} ?? [VCLOffer(payload: [:])]
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
-
func allOffersToArray(_ allOffers: [VCLOffer]?) -> [[String :
|
|
556
|
+
func allOffersToArray(_ allOffers: [VCLOffer]?) -> [[String : Any]]? {
|
|
557
557
|
return allOffers?.map { [
|
|
558
558
|
"payload": $0.payload,
|
|
559
559
|
"issuerId": $0.issuerId,
|
|
@@ -563,19 +563,19 @@ func allOffersToArray(_ allOffers: [VCLOffer]?) -> [[String : Sendable]]? {
|
|
|
563
563
|
|
|
564
564
|
func credentialTypesFormSchemaToDictionary(
|
|
565
565
|
_ credentialTypesFormSchema: VCLCredentialTypesUIFormSchema
|
|
566
|
-
) -> [String:
|
|
567
|
-
var credentialTypesFormSchemaDictionary = [String:
|
|
566
|
+
) -> [String: Any] {
|
|
567
|
+
var credentialTypesFormSchemaDictionary = [String: Any]()
|
|
568
568
|
credentialTypesFormSchemaDictionary["payload"] = credentialTypesFormSchema.payload
|
|
569
569
|
return credentialTypesFormSchemaDictionary
|
|
570
570
|
}
|
|
571
571
|
|
|
572
572
|
func dictionaryToJwt(
|
|
573
|
-
_ jwtDictionary: [String:
|
|
573
|
+
_ jwtDictionary: [String: Any]?
|
|
574
574
|
) -> VCLJwt {
|
|
575
575
|
return VCLJwt(encodedJwt: jwtDictionary?["encodedJwt"] as? String ?? "")
|
|
576
576
|
}
|
|
577
577
|
|
|
578
|
-
func jwtToDictionary(_ jwt: VCLJwt) -> [String:
|
|
578
|
+
func jwtToDictionary(_ jwt: VCLJwt) -> [String: Any?] {
|
|
579
579
|
return [
|
|
580
580
|
"encodedJwt": jwt.encodedJwt,
|
|
581
581
|
"header": jwt.header,
|
|
@@ -585,22 +585,22 @@ func jwtToDictionary(_ jwt: VCLJwt) -> [String: Sendable?] {
|
|
|
585
585
|
}
|
|
586
586
|
|
|
587
587
|
func dictionaryToPublicJwk(
|
|
588
|
-
_ publicJwkDictionary: [String:
|
|
588
|
+
_ publicJwkDictionary: [String: Any]?
|
|
589
589
|
) -> VCLPublicJwk {
|
|
590
590
|
return VCLPublicJwk(valueStr: (publicJwkDictionary?["valueStr"] as? String ?? ""))
|
|
591
591
|
}
|
|
592
592
|
|
|
593
593
|
func publicJwkToDictionary(
|
|
594
594
|
_ publicJwk: VCLPublicJwk?
|
|
595
|
-
) -> [String:
|
|
595
|
+
) -> [String: Any] {
|
|
596
596
|
return ["valueStr": publicJwk?.valueStr ?? ""]
|
|
597
597
|
}
|
|
598
598
|
|
|
599
599
|
func dictionaryToFinalizedOffersDescriptor(
|
|
600
|
-
_ finalizedOffersDescriptorDictionary: [String:
|
|
600
|
+
_ finalizedOffersDescriptorDictionary: [String: Any]
|
|
601
601
|
) -> VCLFinalizeOffersDescriptor {
|
|
602
602
|
return VCLFinalizeOffersDescriptor(
|
|
603
|
-
credentialManifest: dictionaryToCredentialManifest(finalizedOffersDescriptorDictionary["credentialManifest"] as? [String :
|
|
603
|
+
credentialManifest: dictionaryToCredentialManifest(finalizedOffersDescriptorDictionary["credentialManifest"] as? [String : Any]),
|
|
604
604
|
challenge: finalizedOffersDescriptorDictionary["challenge"] as? String,
|
|
605
605
|
approvedOfferIds: finalizedOffersDescriptorDictionary["approvedOfferIds"] as? [String] ?? [String](),
|
|
606
606
|
rejectedOfferIds: finalizedOffersDescriptorDictionary["rejectedOfferIds"] as? [String] ?? [String]()
|
|
@@ -609,8 +609,8 @@ func dictionaryToFinalizedOffersDescriptor(
|
|
|
609
609
|
|
|
610
610
|
func jwtVerifiableCredentialsToDictionary(
|
|
611
611
|
_ jwtVerifiableCredentials: VCLJwtVerifiableCredentials
|
|
612
|
-
) -> [String:
|
|
613
|
-
var jwtVerifiableCredentialsDictionary = [String:
|
|
612
|
+
) -> [String: Any] {
|
|
613
|
+
var jwtVerifiableCredentialsDictionary = [String: Any]()
|
|
614
614
|
let passedCredentials = jwtVerifiableCredentials.passedCredentials.map {
|
|
615
615
|
jwtToDictionary($0)
|
|
616
616
|
}
|
|
@@ -623,7 +623,7 @@ func jwtVerifiableCredentialsToDictionary(
|
|
|
623
623
|
}
|
|
624
624
|
|
|
625
625
|
func readableMapToCredentialTypesUIFormSchemaDescriptor(
|
|
626
|
-
_ credentialTypesUIFormSchemaDescriptorDictionary: [String:
|
|
626
|
+
_ credentialTypesUIFormSchemaDescriptorDictionary: [String: Any]
|
|
627
627
|
) -> VCLCredentialTypesUIFormSchemaDescriptor {
|
|
628
628
|
return VCLCredentialTypesUIFormSchemaDescriptor(
|
|
629
629
|
credentialType: credentialTypesUIFormSchemaDescriptorDictionary["credentialType"] as? String ?? "",
|
|
@@ -632,15 +632,15 @@ func readableMapToCredentialTypesUIFormSchemaDescriptor(
|
|
|
632
632
|
}
|
|
633
633
|
|
|
634
634
|
func dictionaryToVerifiedProfileDescriptor(
|
|
635
|
-
_ verifiedProfileDescriptor: [String:
|
|
635
|
+
_ verifiedProfileDescriptor: [String: Any]
|
|
636
636
|
) -> VCLVerifiedProfileDescriptor {
|
|
637
637
|
return VCLVerifiedProfileDescriptor(did: (verifiedProfileDescriptor["did"] as? String) ?? "")
|
|
638
638
|
}
|
|
639
639
|
|
|
640
640
|
func verifiedProfileToDictionary(
|
|
641
641
|
_ verifiedProfile: VCLVerifiedProfile
|
|
642
|
-
) -> [String:
|
|
643
|
-
var verifiedProfileDictionary = [String:
|
|
642
|
+
) -> [String: Any] {
|
|
643
|
+
var verifiedProfileDictionary = [String: Any]()
|
|
644
644
|
verifiedProfileDictionary["payload"] = verifiedProfile.payload
|
|
645
645
|
verifiedProfileDictionary["id"] = verifiedProfile.id
|
|
646
646
|
verifiedProfileDictionary["logo"] = verifiedProfile.logo
|
|
@@ -649,22 +649,22 @@ func verifiedProfileToDictionary(
|
|
|
649
649
|
}
|
|
650
650
|
|
|
651
651
|
func dictionaryToVerifiedProfile(
|
|
652
|
-
_ verifiedProfileDictionary: [String:
|
|
652
|
+
_ verifiedProfileDictionary: [String: Any]?
|
|
653
653
|
) -> VCLVerifiedProfile {
|
|
654
|
-
return VCLVerifiedProfile(payload: verifiedProfileDictionary?["payload"] as? [String :
|
|
654
|
+
return VCLVerifiedProfile(payload: verifiedProfileDictionary?["payload"] as? [String : Any] ?? [String : Any]())
|
|
655
655
|
}
|
|
656
656
|
|
|
657
657
|
func dictionaryToJwtDescriptor(
|
|
658
|
-
_ jwtDescriptorDictionary: [String:
|
|
658
|
+
_ jwtDescriptorDictionary: [String: Any]
|
|
659
659
|
) -> VCLJwtDescriptor {
|
|
660
660
|
return VCLJwtDescriptor(
|
|
661
|
-
payload: jwtDescriptorDictionary["payload"] as? [String:
|
|
661
|
+
payload: jwtDescriptorDictionary["payload"] as? [String: Any] ?? [String: Any](),
|
|
662
662
|
jti: jwtDescriptorDictionary["jti"] as? String ?? "",
|
|
663
663
|
iss: jwtDescriptorDictionary["iss"] as? String ?? ""
|
|
664
664
|
)
|
|
665
665
|
}
|
|
666
666
|
|
|
667
|
-
func didJwkToDictionary(_ didJwk: VCLDidJwk) -> [String:
|
|
667
|
+
func didJwkToDictionary(_ didJwk: VCLDidJwk) -> [String: Any] {
|
|
668
668
|
return [
|
|
669
669
|
"did": didJwk.did,
|
|
670
670
|
"publicJwk": publicJwkToDictionary(didJwk.publicJwk),
|
|
@@ -673,18 +673,18 @@ func didJwkToDictionary(_ didJwk: VCLDidJwk) -> [String: Sendable] {
|
|
|
673
673
|
]
|
|
674
674
|
}
|
|
675
675
|
|
|
676
|
-
func dictionaryToDidJwk(_ didJwkDictionary: [String:
|
|
676
|
+
func dictionaryToDidJwk(_ didJwkDictionary: [String: Any]?) -> VCLDidJwk {
|
|
677
677
|
return VCLDidJwk(
|
|
678
678
|
did: didJwkDictionary?["did"] as? String ?? "",
|
|
679
|
-
publicJwk: dictionaryToPublicJwk(didJwkDictionary?["publicJwk"] as? [String :
|
|
679
|
+
publicJwk: dictionaryToPublicJwk(didJwkDictionary?["publicJwk"] as? [String : Any]),
|
|
680
680
|
kid: didJwkDictionary?["kid"] as? String ?? "",
|
|
681
681
|
keyId: didJwkDictionary?["keyId"] as? String ?? ""
|
|
682
682
|
)
|
|
683
683
|
}
|
|
684
684
|
|
|
685
|
-
func dictionaryToDidJwkDescriptor(_ didJwkDescriptorDictionary: [String:
|
|
685
|
+
func dictionaryToDidJwkDescriptor(_ didJwkDescriptorDictionary: [String: Any]?) -> VCLDidJwkDescriptor {
|
|
686
686
|
return VCLDidJwkDescriptor(
|
|
687
687
|
signatureAlgorithm: VCLSignatureAlgorithm.fromString(value: didJwkDescriptorDictionary?["signatureAlgorithm"] as? String ?? ""),
|
|
688
|
-
remoteCryptoServicesToken: dictionaryToToken(didJwkDescriptorDictionary?["remoteCryptoServicesToken"] as? [String:
|
|
688
|
+
remoteCryptoServicesToken: dictionaryToToken(didJwkDescriptorDictionary?["remoteCryptoServicesToken"] as? [String: Any])
|
|
689
689
|
)
|
|
690
690
|
}
|
package/ios/VclReactNative.swift
CHANGED
|
@@ -8,19 +8,19 @@ import VCL
|
|
|
8
8
|
|
|
9
9
|
@objc(VclReactNative)
|
|
10
10
|
class VclReactNative: NSObject {
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
private let vcl = VCLProvider.vclInstance()
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
|
|
14
|
+
private func initGlobalConfigurations(
|
|
15
15
|
_ initializationDescriptor: VCLInitializationDescriptor
|
|
16
16
|
) {
|
|
17
17
|
GlobalConfig.CurrentEnvironment = initializationDescriptor.environment
|
|
18
18
|
GlobalConfig.IsDebugOn = initializationDescriptor.isDebugOn
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
@
|
|
20
|
+
|
|
21
|
+
@objc(initialize:withResolver:withRejecter:)
|
|
22
22
|
func initialize(
|
|
23
|
-
initializationDescriptorDictionary: [String:
|
|
23
|
+
initializationDescriptorDictionary: [String: Any],
|
|
24
24
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
25
25
|
) {
|
|
26
26
|
let initializationDescriptor = dictionaryToInitializationDescriptor(initializationDescriptorDictionary)
|
|
@@ -34,8 +34,8 @@ class VclReactNative: NSObject {
|
|
|
34
34
|
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
35
35
|
})
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
@
|
|
37
|
+
|
|
38
|
+
@objc(getCountries:withRejecter:)
|
|
39
39
|
func getCountries(
|
|
40
40
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
41
41
|
) {
|
|
@@ -46,8 +46,8 @@ class VclReactNative: NSObject {
|
|
|
46
46
|
reject(nil, message, VCLError(message: message))
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
@
|
|
49
|
+
|
|
50
|
+
@objc(getCredentialTypeSchemas:withRejecter:)
|
|
51
51
|
func getCredentialTypeSchemas(
|
|
52
52
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
53
53
|
) {
|
|
@@ -58,8 +58,8 @@ class VclReactNative: NSObject {
|
|
|
58
58
|
reject(nil, message, VCLError(message: message))
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
@
|
|
61
|
+
|
|
62
|
+
@objc(getCredentialTypes:withRejecter:)
|
|
63
63
|
func getCredentialTypes(
|
|
64
64
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
65
65
|
) {
|
|
@@ -70,10 +70,10 @@ class VclReactNative: NSObject {
|
|
|
70
70
|
reject(nil, message, VCLError(message: message))
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
@
|
|
73
|
+
|
|
74
|
+
@objc(getPresentationRequest:withResolver:withRejecter:)
|
|
75
75
|
func getPresentationRequest(
|
|
76
|
-
presentationRequestDescriptorDictionary: [String:
|
|
76
|
+
presentationRequestDescriptorDictionary: [String: Any],
|
|
77
77
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
78
78
|
) {
|
|
79
79
|
vcl.getPresentationRequest(
|
|
@@ -86,10 +86,10 @@ class VclReactNative: NSObject {
|
|
|
86
86
|
}
|
|
87
87
|
)
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
@
|
|
89
|
+
|
|
90
|
+
@objc(submitPresentation:withResolver:withRejecter:)
|
|
91
91
|
func submitPresentation(
|
|
92
|
-
presentationSubmissionDictionary: [String:
|
|
92
|
+
presentationSubmissionDictionary: [String: Any],
|
|
93
93
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
94
94
|
) {
|
|
95
95
|
vcl.submitPresentation(
|
|
@@ -103,10 +103,10 @@ class VclReactNative: NSObject {
|
|
|
103
103
|
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
104
104
|
})
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
@
|
|
106
|
+
|
|
107
|
+
@objc(getExchangeProgress:withResolver:withRejecter:)
|
|
108
108
|
func getExchangeProgress(
|
|
109
|
-
exchangeDescriptorDictionary: [String:
|
|
109
|
+
exchangeDescriptorDictionary: [String: Any],
|
|
110
110
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
111
111
|
) {
|
|
112
112
|
vcl.getExchangeProgress(
|
|
@@ -118,10 +118,10 @@ class VclReactNative: NSObject {
|
|
|
118
118
|
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
119
119
|
})
|
|
120
120
|
}
|
|
121
|
-
|
|
122
|
-
@
|
|
121
|
+
|
|
122
|
+
@objc(searchForOrganizations:withResolver:withRejecter:)
|
|
123
123
|
func searchForOrganizations(
|
|
124
|
-
organizationsSearchDescriptorDictionary: [String:
|
|
124
|
+
organizationsSearchDescriptorDictionary: [String: Any],
|
|
125
125
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
126
126
|
) {
|
|
127
127
|
vcl.searchForOrganizations(
|
|
@@ -133,10 +133,10 @@ class VclReactNative: NSObject {
|
|
|
133
133
|
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
134
134
|
})
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
@
|
|
136
|
+
|
|
137
|
+
@objc(getCredentialManifest:withResolver:withRejecter:)
|
|
138
138
|
func getCredentialManifest(
|
|
139
|
-
credentialManifestDescriptorDictionary: [String:
|
|
139
|
+
credentialManifestDescriptorDictionary: [String: Any],
|
|
140
140
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
141
141
|
) {
|
|
142
142
|
VCLLog.d("credentialManifestDescriptorDictionary dictionary: \(credentialManifestDescriptorDictionary)")
|
|
@@ -154,10 +154,10 @@ class VclReactNative: NSObject {
|
|
|
154
154
|
reject(nil, "Unexpected Credential Credential Manifest Descriptor: \(credentialManifestDescriptorDictionary)", nil)
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
|
|
158
|
-
@
|
|
157
|
+
|
|
158
|
+
@objc(generateOffers:withResolver:withRejecter:)
|
|
159
159
|
func generateOffers(
|
|
160
|
-
generateOffersDescriptorDictionary: [String:
|
|
160
|
+
generateOffersDescriptorDictionary: [String: Any],
|
|
161
161
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
162
162
|
) {
|
|
163
163
|
vcl.generateOffers(
|
|
@@ -169,11 +169,11 @@ class VclReactNative: NSObject {
|
|
|
169
169
|
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
170
170
|
})
|
|
171
171
|
}
|
|
172
|
-
|
|
173
|
-
@
|
|
172
|
+
|
|
173
|
+
@objc(checkForOffers:withtSessionTokenDictionary:withResolver:withRejecter:)
|
|
174
174
|
func checkForOffers(
|
|
175
|
-
generateOffersDescriptorDictionary: [String:
|
|
176
|
-
sessionTokenDictionary: [String:
|
|
175
|
+
generateOffersDescriptorDictionary: [String: Any],
|
|
176
|
+
sessionTokenDictionary: [String: Any],
|
|
177
177
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
178
178
|
) {
|
|
179
179
|
vcl.checkForOffers(
|
|
@@ -186,11 +186,11 @@ class VclReactNative: NSObject {
|
|
|
186
186
|
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
187
187
|
})
|
|
188
188
|
}
|
|
189
|
-
|
|
190
|
-
@
|
|
189
|
+
|
|
190
|
+
@objc(finalizeOffers:withSessionTokenDictionary:withResolver:withRejecter:)
|
|
191
191
|
func finalizeOffers(
|
|
192
|
-
finalizeOffersDescriptorDictionary: [String:
|
|
193
|
-
sessionTokenDictionary: [String:
|
|
192
|
+
finalizeOffersDescriptorDictionary: [String: Any],
|
|
193
|
+
sessionTokenDictionary: [String: Any],
|
|
194
194
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
195
195
|
) {
|
|
196
196
|
vcl.finalizeOffers(
|
|
@@ -203,10 +203,10 @@ class VclReactNative: NSObject {
|
|
|
203
203
|
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
204
204
|
})
|
|
205
205
|
}
|
|
206
|
-
|
|
207
|
-
@
|
|
206
|
+
|
|
207
|
+
@objc(getCredentialTypesUIFormSchema:withResolver:withRejecter:)
|
|
208
208
|
func getCredentialTypesUIFormSchema(
|
|
209
|
-
credentialTypesUIFormSchemaDescriptorDictionary: [String:
|
|
209
|
+
credentialTypesUIFormSchemaDescriptorDictionary: [String: Any],
|
|
210
210
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
211
211
|
) {
|
|
212
212
|
vcl.getCredentialTypesUIFormSchema(
|
|
@@ -219,10 +219,10 @@ class VclReactNative: NSObject {
|
|
|
219
219
|
}
|
|
220
220
|
)
|
|
221
221
|
}
|
|
222
|
-
|
|
223
|
-
@
|
|
222
|
+
|
|
223
|
+
@objc(getVerifiedProfile:withResolver:withRejecter:)
|
|
224
224
|
func getVerifiedProfile(
|
|
225
|
-
verifiedProfileDescriptorDictionary: [String:
|
|
225
|
+
verifiedProfileDescriptorDictionary: [String: Any],
|
|
226
226
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
227
227
|
) {
|
|
228
228
|
vcl.getVerifiedProfile(
|
|
@@ -234,12 +234,12 @@ class VclReactNative: NSObject {
|
|
|
234
234
|
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
235
235
|
})
|
|
236
236
|
}
|
|
237
|
-
|
|
238
|
-
@
|
|
237
|
+
|
|
238
|
+
@objc(verifyJwt:withPublicJwkDictionary:withRemoteCryptoServicesTokenDictionary:withResolver:withRejecter:)
|
|
239
239
|
func verifyJwt(
|
|
240
|
-
jwtDictionary: [String:
|
|
241
|
-
publicJwkDictionary: [String:
|
|
242
|
-
remoteCryptoServicesTokenDictionary: [String:
|
|
240
|
+
jwtDictionary: [String: Any],
|
|
241
|
+
publicJwkDictionary: [String: Any],
|
|
242
|
+
remoteCryptoServicesTokenDictionary: [String: Any]? = nil,
|
|
243
243
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
244
244
|
) {
|
|
245
245
|
vcl.verifyJwt(
|
|
@@ -253,12 +253,12 @@ class VclReactNative: NSObject {
|
|
|
253
253
|
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
254
254
|
})
|
|
255
255
|
}
|
|
256
|
-
|
|
257
|
-
@
|
|
256
|
+
|
|
257
|
+
@objc(generateSignedJwt:withDidJwkDictionary:withRemoteCryptoServicesTokenDictionary:withResolver:withRejecter:)
|
|
258
258
|
func generateSignedJwt(
|
|
259
|
-
jwtDescriptorDictionary: [String:
|
|
260
|
-
didJwkDictionary: [String:
|
|
261
|
-
remoteCryptoServicesTokenDictionary: [String:
|
|
259
|
+
jwtDescriptorDictionary: [String: Any],
|
|
260
|
+
didJwkDictionary: [String: Any],
|
|
261
|
+
remoteCryptoServicesTokenDictionary: [String: Any]? = nil,
|
|
262
262
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
263
263
|
) {
|
|
264
264
|
vcl.generateSignedJwt(
|
|
@@ -272,10 +272,10 @@ class VclReactNative: NSObject {
|
|
|
272
272
|
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
273
273
|
})
|
|
274
274
|
}
|
|
275
|
-
|
|
276
|
-
@
|
|
275
|
+
|
|
276
|
+
@objc(generateDidJwk:withResolver:withRejecter:)
|
|
277
277
|
func generateDidJwk(
|
|
278
|
-
didJwkDescriptorDictionary: [String:
|
|
278
|
+
didJwkDescriptorDictionary: [String: Any]? = nil,
|
|
279
279
|
resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
280
280
|
) {
|
|
281
281
|
vcl.generateDidJwk(
|
package/package.json
CHANGED
|
@@ -19,9 +19,9 @@ Pod::Spec.new do |s|
|
|
|
19
19
|
# https://github.com/CocoaPods/CocoaPods/issues/7234#issuecomment-346136322
|
|
20
20
|
# s.static_framework = true
|
|
21
21
|
|
|
22
|
-
s.swift_version = "5"
|
|
22
|
+
# s.swift_version = "5"
|
|
23
23
|
|
|
24
|
-
s.dependency "VCL", "2.6.
|
|
24
|
+
s.dependency "VCL", "2.6.6"
|
|
25
25
|
|
|
26
26
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
27
27
|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|