@procivis/react-native-one-core 1.94025.0 → 1.98296.0
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/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +71 -30
- package/android/src/main/java/ch/procivis/one/core/SerializeSpecific.kt +45 -38
- package/android/src/main/java/ch/procivis/one/core/Util.kt +3 -3
- package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt +3 -3
- package/core-sdk.json +6 -6
- package/dist/src/config.d.ts +47 -33
- package/dist/src/config.js +63 -53
- package/dist/src/core.d.ts +7 -7
- package/dist/src/core.js +12 -7
- package/dist/src/one-core-uniffi-intf.d.ts +1213 -701
- package/dist/src/one-core-uniffi-intf.js +385 -353
- package/ios/ProcivisOneCoreModule.m +29 -6
- package/ios/ProcivisOneCoreModule.swift +102 -38
- package/ios/RSEKeyStorage.swift +2 -2
- package/ios/RSEPinPad.swift +0 -4
- package/ios/RSEPinPadManager.m +0 -1
- package/ios/Serialize.swift +17 -12
- package/ios/Util.swift +1 -1
- package/package.json +1 -1
|
@@ -21,13 +21,13 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
21
21
|
ReactContextBaseJavaModule(reactContext) {
|
|
22
22
|
override fun getName() = "ProcivisOneCoreModule"
|
|
23
23
|
|
|
24
|
-
private var oneCore:
|
|
24
|
+
private var oneCore: OneCoreInterface? = null
|
|
25
25
|
private var nfcHce: NfcHce = NfcHCE(reactContext)
|
|
26
26
|
private val scope = CoroutineScope(EmptyCoroutineContext)
|
|
27
27
|
|
|
28
|
-
private fun getCore():
|
|
29
|
-
return oneCore ?: throw
|
|
30
|
-
|
|
28
|
+
private fun getCore(): OneCoreInterface {
|
|
29
|
+
return oneCore ?: throw OneCoreException.Response(
|
|
30
|
+
ErrorResponse(
|
|
31
31
|
"BR_0184",
|
|
32
32
|
"core not initialized",
|
|
33
33
|
null
|
|
@@ -37,8 +37,8 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
37
37
|
|
|
38
38
|
private var ubiqu: UbiquKeyStorage? = null
|
|
39
39
|
private fun getUbiqu(): UbiquKeyStorage {
|
|
40
|
-
return ubiqu ?: throw
|
|
41
|
-
|
|
40
|
+
return ubiqu ?: throw OneCoreException.Response(
|
|
41
|
+
ErrorResponse(
|
|
42
42
|
"BR_0184",
|
|
43
43
|
"ubiqu not initialized",
|
|
44
44
|
null
|
|
@@ -54,7 +54,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
54
54
|
oneCore =
|
|
55
55
|
initializeCore(
|
|
56
56
|
context = context,
|
|
57
|
-
params =
|
|
57
|
+
params = InitParams(
|
|
58
58
|
configJson = configJson,
|
|
59
59
|
nativeSecureElement = AndroidKeyStoreKeyStorage(context),
|
|
60
60
|
remoteSecureElement = ubiqu,
|
|
@@ -85,9 +85,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
@ReactMethod
|
|
88
|
-
fun runTask(task: String, promise: Promise) {
|
|
88
|
+
fun runTask(task: String, params: String?, promise: Promise) {
|
|
89
89
|
asyncCall(promise, scope) {
|
|
90
|
-
return@asyncCall getCore().runTask(task)
|
|
90
|
+
return@asyncCall getCore().runTask(task, params)
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -145,9 +145,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
@ReactMethod
|
|
148
|
-
fun
|
|
148
|
+
fun listDids(query: ReadableMap, promise: Promise) {
|
|
149
149
|
asyncCall(promise, scope) {
|
|
150
|
-
val dids = getCore().
|
|
150
|
+
val dids = getCore().listDids(construct(query))
|
|
151
151
|
return@asyncCall convertToRN(dids)
|
|
152
152
|
}
|
|
153
153
|
}
|
|
@@ -260,17 +260,17 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
260
260
|
) {
|
|
261
261
|
asyncCall(promise, scope) {
|
|
262
262
|
val submitCredentials =
|
|
263
|
-
mutableMapOf<String, List<
|
|
263
|
+
mutableMapOf<String, List<PresentationSubmitCredentialRequest>>()
|
|
264
264
|
for (entry in credentials.entryIterator) {
|
|
265
265
|
val credentialList = when (val credentialValue = entry.value) {
|
|
266
266
|
is ReadableMap -> {
|
|
267
267
|
// Single credential object - convert to list
|
|
268
|
-
listOf(construct<
|
|
268
|
+
listOf(construct<PresentationSubmitCredentialRequest>(credentialValue))
|
|
269
269
|
}
|
|
270
270
|
is ReadableArray -> {
|
|
271
271
|
// Array of credentials - convert each one
|
|
272
272
|
(0 until credentialValue.size()).map { index ->
|
|
273
|
-
construct<
|
|
273
|
+
construct<PresentationSubmitCredentialRequest>(credentialValue.getMap(index)!!)
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
else -> {
|
|
@@ -292,13 +292,13 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
292
292
|
) {
|
|
293
293
|
asyncCall(promise, scope) {
|
|
294
294
|
val submission =
|
|
295
|
-
mutableMapOf<String, List<
|
|
295
|
+
mutableMapOf<String, List<PresentationSubmitV2CredentialRequest>>()
|
|
296
296
|
for (entry in credentials.entryIterator) {
|
|
297
297
|
val credentialList = when (val credentialValue = entry.value) {
|
|
298
298
|
is ReadableMap -> {
|
|
299
299
|
// Single credential object - convert to list
|
|
300
300
|
listOf(
|
|
301
|
-
construct<
|
|
301
|
+
construct<PresentationSubmitV2CredentialRequest>(
|
|
302
302
|
credentialValue
|
|
303
303
|
)
|
|
304
304
|
)
|
|
@@ -307,7 +307,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
307
307
|
is ReadableArray -> {
|
|
308
308
|
// Array of credentials - convert each one
|
|
309
309
|
(0 until credentialValue.size()).map { index ->
|
|
310
|
-
construct<
|
|
310
|
+
construct<PresentationSubmitV2CredentialRequest>(
|
|
311
311
|
credentialValue.getMap(index)!!
|
|
312
312
|
)
|
|
313
313
|
}
|
|
@@ -328,9 +328,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
@ReactMethod
|
|
331
|
-
fun
|
|
331
|
+
fun listCredentials(query: ReadableMap, promise: Promise) {
|
|
332
332
|
asyncCall(promise, scope) {
|
|
333
|
-
val credentials = getCore().
|
|
333
|
+
val credentials = getCore().listCredentials(construct(query))
|
|
334
334
|
return@asyncCall convertToRN(credentials)
|
|
335
335
|
}
|
|
336
336
|
}
|
|
@@ -367,9 +367,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
@ReactMethod
|
|
370
|
-
fun
|
|
370
|
+
fun listCredentialSchemas(query: ReadableMap, promise: Promise) {
|
|
371
371
|
asyncCall(promise, scope) {
|
|
372
|
-
val schemas = getCore().
|
|
372
|
+
val schemas = getCore().listCredentialSchemas(construct(query))
|
|
373
373
|
return@asyncCall convertToRN(schemas)
|
|
374
374
|
}
|
|
375
375
|
}
|
|
@@ -406,9 +406,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
406
406
|
}
|
|
407
407
|
|
|
408
408
|
@ReactMethod
|
|
409
|
-
fun
|
|
409
|
+
fun listProofs(query: ReadableMap, promise: Promise) {
|
|
410
410
|
asyncCall(promise, scope) {
|
|
411
|
-
val proofs = getCore().
|
|
411
|
+
val proofs = getCore().listProofs(construct(query))
|
|
412
412
|
return@asyncCall convertToRN(proofs)
|
|
413
413
|
}
|
|
414
414
|
}
|
|
@@ -437,9 +437,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
@ReactMethod
|
|
440
|
-
fun
|
|
440
|
+
fun listProofSchemas(query: ReadableMap, promise: Promise) {
|
|
441
441
|
asyncCall(promise, scope) {
|
|
442
|
-
val schemas = getCore().
|
|
442
|
+
val schemas = getCore().listProofSchemas(construct(query))
|
|
443
443
|
return@asyncCall convertToRN(schemas)
|
|
444
444
|
}
|
|
445
445
|
}
|
|
@@ -481,9 +481,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
481
481
|
}
|
|
482
482
|
|
|
483
483
|
@ReactMethod
|
|
484
|
-
fun
|
|
484
|
+
fun listHistory(query: ReadableMap, promise: Promise) {
|
|
485
485
|
asyncCall(promise, scope) {
|
|
486
|
-
val history = getCore().
|
|
486
|
+
val history = getCore().listHistory(construct(query))
|
|
487
487
|
return@asyncCall convertToRN(history)
|
|
488
488
|
}
|
|
489
489
|
}
|
|
@@ -640,9 +640,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
640
640
|
@ReactMethod
|
|
641
641
|
fun deleteCache(types: ReadableArray?, promise: Promise) {
|
|
642
642
|
asyncCall(promise, scope) {
|
|
643
|
-
var cacheTypeList: List<
|
|
643
|
+
var cacheTypeList: List<CacheType>? = null;
|
|
644
644
|
if (types != null) {
|
|
645
|
-
cacheTypeList = enumList(types,
|
|
645
|
+
cacheTypeList = enumList(types, CacheType::valueOf)
|
|
646
646
|
}
|
|
647
647
|
getCore().deleteCache(cacheTypeList)
|
|
648
648
|
return@asyncCall null
|
|
@@ -652,7 +652,8 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
652
652
|
@ReactMethod
|
|
653
653
|
fun holderRegisterWalletUnit(request: ReadableMap, promise: Promise) {
|
|
654
654
|
asyncCall(promise, scope) {
|
|
655
|
-
|
|
655
|
+
val result = getCore().holderRegisterWalletUnit(construct(request))
|
|
656
|
+
return@asyncCall convertToRN(result)
|
|
656
657
|
}
|
|
657
658
|
}
|
|
658
659
|
|
|
@@ -664,6 +665,14 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
664
665
|
}
|
|
665
666
|
}
|
|
666
667
|
|
|
668
|
+
@ReactMethod
|
|
669
|
+
fun holderWalletUnitUpdate(walletUnitId: String, request: ReadableMap, promise: Promise) {
|
|
670
|
+
asyncCall(promise, scope) {
|
|
671
|
+
getCore().holderWalletUnitUpdate(walletUnitId, construct(request))
|
|
672
|
+
return@asyncCall null
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
667
676
|
@ReactMethod
|
|
668
677
|
fun holderGetWalletUnit(walletUnitId: String, promise: Promise) {
|
|
669
678
|
asyncCall(promise, scope) {
|
|
@@ -672,6 +681,38 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
672
681
|
}
|
|
673
682
|
}
|
|
674
683
|
|
|
684
|
+
@ReactMethod
|
|
685
|
+
fun holderGetWalletUnitTrustCollections(walletUnitId: String, promise: Promise) {
|
|
686
|
+
asyncCall(promise, scope) {
|
|
687
|
+
val result = getCore().holderGetWalletUnitTrustCollections(walletUnitId)
|
|
688
|
+
return@asyncCall convertToRN(result)
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
@ReactMethod
|
|
693
|
+
fun registerVerifierInstance(request: ReadableMap, promise: Promise) {
|
|
694
|
+
asyncCall(promise, scope) {
|
|
695
|
+
val result = getCore().registerVerifierInstance(construct(request))
|
|
696
|
+
return@asyncCall convertToRN(result)
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
@ReactMethod
|
|
701
|
+
fun updateVerifierInstance(verifierInstanceId: String, request: ReadableMap, promise: Promise) {
|
|
702
|
+
asyncCall(promise, scope) {
|
|
703
|
+
getCore().updateVerifierInstance(verifierInstanceId, construct(request))
|
|
704
|
+
return@asyncCall null
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
@ReactMethod
|
|
709
|
+
fun getVerifierInstanceTrustCollections(verifierInstanceId: String, promise: Promise) {
|
|
710
|
+
asyncCall(promise, scope) {
|
|
711
|
+
val result = getCore().getVerifierInstanceTrustCollections(verifierInstanceId)
|
|
712
|
+
return@asyncCall convertToRN(result)
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
|
|
675
716
|
@ReactMethod
|
|
676
717
|
fun nfcReadIsoMdlEngagement(request: ReadableMap, promise: Promise) {
|
|
677
718
|
asyncCall(promise, scope) {
|
|
@@ -9,12 +9,12 @@ object SerializeSpecific {
|
|
|
9
9
|
object Obj {
|
|
10
10
|
private val CustomConversionTypes =
|
|
11
11
|
arrayOf(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
HistoryMetadata::class.java,
|
|
13
|
+
ClaimValue::class.java,
|
|
14
|
+
ProofClaimValue::class.java,
|
|
15
|
+
ApplicableCredentialOrFailureHint::class.java,
|
|
16
|
+
PresentationDefinitionV2ClaimValue::class.java,
|
|
17
|
+
HandleInvitationResponse::class.java,
|
|
18
18
|
)
|
|
19
19
|
|
|
20
20
|
fun isCustomConversionType(input: Any?): Boolean {
|
|
@@ -27,31 +27,31 @@ object SerializeSpecific {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
fun convertCustom(input: Any): ReadableMap {
|
|
30
|
-
if (input is
|
|
30
|
+
if (input is HistoryMetadata) {
|
|
31
31
|
return historyMetadata(input)
|
|
32
32
|
}
|
|
33
|
-
if (input is
|
|
33
|
+
if (input is ClaimValue) {
|
|
34
34
|
return claimValue(input)
|
|
35
35
|
}
|
|
36
|
-
if (input is
|
|
36
|
+
if (input is ProofClaimValue) {
|
|
37
37
|
return proofClaimValue(input)
|
|
38
38
|
}
|
|
39
|
-
if (input is
|
|
39
|
+
if (input is ApplicableCredentialOrFailureHint) {
|
|
40
40
|
return credentialQuery(input)
|
|
41
41
|
}
|
|
42
|
-
if (input is
|
|
42
|
+
if (input is PresentationDefinitionV2ClaimValue) {
|
|
43
43
|
return presentationDefinitionV2ClaimValue(input)
|
|
44
44
|
}
|
|
45
|
-
if (input is
|
|
45
|
+
if (input is HandleInvitationResponse) {
|
|
46
46
|
return invitationResponse(input)
|
|
47
47
|
}
|
|
48
48
|
throw IllegalArgumentException("Invalid map conversion: $input")
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
private fun historyMetadata(metadata:
|
|
51
|
+
private fun historyMetadata(metadata: HistoryMetadata): ReadableMap {
|
|
52
52
|
val result = Arguments.createMap()
|
|
53
53
|
when (metadata) {
|
|
54
|
-
is
|
|
54
|
+
is HistoryMetadata.UnexportableEntities -> {
|
|
55
55
|
result.putString("type_", "UNEXPORTABLE_ENTITIES")
|
|
56
56
|
result.putMap(
|
|
57
57
|
"value",
|
|
@@ -59,7 +59,7 @@ object SerializeSpecific {
|
|
|
59
59
|
)
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
is
|
|
62
|
+
is HistoryMetadata.ErrorMetadata -> {
|
|
63
63
|
result.putString("type_", "ERROR_METADATA")
|
|
64
64
|
result.putMap(
|
|
65
65
|
"value",
|
|
@@ -67,20 +67,27 @@ object SerializeSpecific {
|
|
|
67
67
|
)
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
is
|
|
70
|
+
is HistoryMetadata.WalletUnitJwt -> {
|
|
71
71
|
result.putString("type_", "WALLET_UNIT_JWT")
|
|
72
72
|
val values = Arguments.createArray()
|
|
73
73
|
values.pushString(metadata.v1)
|
|
74
74
|
result.putArray("value", values)
|
|
75
75
|
}
|
|
76
|
+
|
|
77
|
+
is HistoryMetadata.Certificate -> {
|
|
78
|
+
result.putString("type_", "CERTIFICATE")
|
|
79
|
+
val values = Arguments.createArray()
|
|
80
|
+
values.pushString(metadata.v1)
|
|
81
|
+
result.putArray("value", values)
|
|
82
|
+
}
|
|
76
83
|
}
|
|
77
84
|
return result
|
|
78
85
|
}
|
|
79
86
|
|
|
80
|
-
private fun credentialQuery(query:
|
|
87
|
+
private fun credentialQuery(query: ApplicableCredentialOrFailureHint): ReadableMap {
|
|
81
88
|
val result = Arguments.createMap()
|
|
82
89
|
when (query) {
|
|
83
|
-
is
|
|
90
|
+
is ApplicableCredentialOrFailureHint.ApplicableCredentials -> {
|
|
84
91
|
result.putString("type_", "APPLICABLE_CREDENTIALS")
|
|
85
92
|
result.putArray(
|
|
86
93
|
"applicableCredentials",
|
|
@@ -88,7 +95,7 @@ object SerializeSpecific {
|
|
|
88
95
|
)
|
|
89
96
|
}
|
|
90
97
|
|
|
91
|
-
is
|
|
98
|
+
is ApplicableCredentialOrFailureHint.FailureHint -> {
|
|
92
99
|
result.putString("type_", "FAILURE_HINT")
|
|
93
100
|
result.putMap("failureHint", convertToRN(query.failureHint) as ReadableMap)
|
|
94
101
|
}
|
|
@@ -96,20 +103,20 @@ object SerializeSpecific {
|
|
|
96
103
|
return result
|
|
97
104
|
}
|
|
98
105
|
|
|
99
|
-
private fun claimValue(value:
|
|
106
|
+
private fun claimValue(value: ClaimValue): ReadableMap {
|
|
100
107
|
val result = Arguments.createMap()
|
|
101
108
|
when (value) {
|
|
102
|
-
is
|
|
109
|
+
is ClaimValue.Boolean -> {
|
|
103
110
|
result.putString("type_", "BOOLEAN")
|
|
104
111
|
result.putBoolean("value", value.value)
|
|
105
112
|
}
|
|
106
113
|
|
|
107
|
-
is
|
|
114
|
+
is ClaimValue.Float -> {
|
|
108
115
|
result.putString("type_", "FLOAT")
|
|
109
116
|
result.putDouble("value", value.value)
|
|
110
117
|
}
|
|
111
118
|
|
|
112
|
-
is
|
|
119
|
+
is ClaimValue.Integer -> {
|
|
113
120
|
result.putString("type_", "INTEGER")
|
|
114
121
|
if (value.value < Int.MIN_VALUE || value.value > Int.MAX_VALUE) {
|
|
115
122
|
result.putDouble("value", value.value.toDouble())
|
|
@@ -118,12 +125,12 @@ object SerializeSpecific {
|
|
|
118
125
|
}
|
|
119
126
|
}
|
|
120
127
|
|
|
121
|
-
is
|
|
128
|
+
is ClaimValue.String -> {
|
|
122
129
|
result.putString("type_", "STRING")
|
|
123
130
|
result.putString("value", value.value)
|
|
124
131
|
}
|
|
125
132
|
|
|
126
|
-
is
|
|
133
|
+
is ClaimValue.Nested -> {
|
|
127
134
|
result.putString("type_", "NESTED")
|
|
128
135
|
result.putArray("value", convertToRN(value.value) as ReadableArray)
|
|
129
136
|
}
|
|
@@ -131,15 +138,15 @@ object SerializeSpecific {
|
|
|
131
138
|
return result
|
|
132
139
|
}
|
|
133
140
|
|
|
134
|
-
private fun proofClaimValue(value:
|
|
141
|
+
private fun proofClaimValue(value: ProofClaimValue): ReadableMap {
|
|
135
142
|
val result = Arguments.createMap()
|
|
136
143
|
when (value) {
|
|
137
|
-
is
|
|
144
|
+
is ProofClaimValue.Value -> {
|
|
138
145
|
result.putString("type_", "VALUE")
|
|
139
146
|
result.putString("value", value.value)
|
|
140
147
|
}
|
|
141
148
|
|
|
142
|
-
is
|
|
149
|
+
is ProofClaimValue.Claims -> {
|
|
143
150
|
result.putString("type_", "CLAIMS")
|
|
144
151
|
result.putArray("value", convertToRN(value.value) as ReadableArray)
|
|
145
152
|
}
|
|
@@ -147,20 +154,20 @@ object SerializeSpecific {
|
|
|
147
154
|
return result
|
|
148
155
|
}
|
|
149
156
|
|
|
150
|
-
private fun presentationDefinitionV2ClaimValue(value:
|
|
157
|
+
private fun presentationDefinitionV2ClaimValue(value: PresentationDefinitionV2ClaimValue): ReadableMap {
|
|
151
158
|
val result = Arguments.createMap()
|
|
152
159
|
when (value) {
|
|
153
|
-
is
|
|
160
|
+
is PresentationDefinitionV2ClaimValue.Boolean -> {
|
|
154
161
|
result.putString("type_", "BOOLEAN")
|
|
155
162
|
result.putBoolean("value", value.value)
|
|
156
163
|
}
|
|
157
164
|
|
|
158
|
-
is
|
|
165
|
+
is PresentationDefinitionV2ClaimValue.Float -> {
|
|
159
166
|
result.putString("type_", "FLOAT")
|
|
160
167
|
result.putDouble("value", value.value)
|
|
161
168
|
}
|
|
162
169
|
|
|
163
|
-
is
|
|
170
|
+
is PresentationDefinitionV2ClaimValue.Integer -> {
|
|
164
171
|
result.putString("type_", "INTEGER")
|
|
165
172
|
if (value.value < Int.MIN_VALUE || value.value > Int.MAX_VALUE) {
|
|
166
173
|
result.putDouble("value", value.value.toDouble())
|
|
@@ -169,12 +176,12 @@ object SerializeSpecific {
|
|
|
169
176
|
}
|
|
170
177
|
}
|
|
171
178
|
|
|
172
|
-
is
|
|
179
|
+
is PresentationDefinitionV2ClaimValue.String -> {
|
|
173
180
|
result.putString("type_", "STRING")
|
|
174
181
|
result.putString("value", value.value)
|
|
175
182
|
}
|
|
176
183
|
|
|
177
|
-
is
|
|
184
|
+
is PresentationDefinitionV2ClaimValue.Nested -> {
|
|
178
185
|
result.putString("type_", "NESTED")
|
|
179
186
|
result.putArray("value", convertToRN(value.value) as ReadableArray)
|
|
180
187
|
}
|
|
@@ -182,10 +189,10 @@ object SerializeSpecific {
|
|
|
182
189
|
return result
|
|
183
190
|
}
|
|
184
191
|
|
|
185
|
-
private fun invitationResponse(value:
|
|
192
|
+
private fun invitationResponse(value: HandleInvitationResponse): ReadableMap {
|
|
186
193
|
val result = Arguments.createMap()
|
|
187
194
|
when (value) {
|
|
188
|
-
is
|
|
195
|
+
is HandleInvitationResponse.CredentialIssuance -> {
|
|
189
196
|
result.putString("type_", "CREDENTIAL_ISSUANCE")
|
|
190
197
|
result.putString("interactionId", value.interactionId)
|
|
191
198
|
value.keyStorageSecurityLevels?.let {
|
|
@@ -204,14 +211,14 @@ object SerializeSpecific {
|
|
|
204
211
|
result.putBoolean("requiresWalletInstanceAttestation", value.requiresWalletInstanceAttestation)
|
|
205
212
|
}
|
|
206
213
|
|
|
207
|
-
is
|
|
214
|
+
is HandleInvitationResponse.AuthorizationCodeFlow -> {
|
|
208
215
|
result.putString("type_", "AUTHORIZATION_CODE_FLOW")
|
|
209
216
|
result.putString("interactionId", value.interactionId)
|
|
210
217
|
result.putString("authorizationCodeFlowUrl", value.authorizationCodeFlowUrl)
|
|
211
218
|
result.putString("protocol", value.protocol)
|
|
212
219
|
}
|
|
213
220
|
|
|
214
|
-
is
|
|
221
|
+
is HandleInvitationResponse.ProofRequest -> {
|
|
215
222
|
result.putString("type_", "PROOF_REQUEST")
|
|
216
223
|
result.putString("interactionId", value.interactionId)
|
|
217
224
|
result.putString("proofId", value.proofId)
|
|
@@ -13,7 +13,7 @@ object Util {
|
|
|
13
13
|
override fun run() {
|
|
14
14
|
try {
|
|
15
15
|
promise.resolve(function())
|
|
16
|
-
} catch (error:
|
|
16
|
+
} catch (error: OneCoreException.Response) {
|
|
17
17
|
handleBindingException(promise, error)
|
|
18
18
|
} catch (error: Throwable) {
|
|
19
19
|
promise.reject(error)
|
|
@@ -26,7 +26,7 @@ object Util {
|
|
|
26
26
|
scope.launch {
|
|
27
27
|
try {
|
|
28
28
|
promise.resolve(function())
|
|
29
|
-
} catch (error:
|
|
29
|
+
} catch (error: OneCoreException.Response) {
|
|
30
30
|
handleBindingException(promise, error)
|
|
31
31
|
} catch (error: Throwable) {
|
|
32
32
|
promise.reject(error)
|
|
@@ -34,7 +34,7 @@ object Util {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
private fun handleBindingException(promise: Promise, error:
|
|
37
|
+
private fun handleBindingException(promise: Promise, error: OneCoreException.Response) {
|
|
38
38
|
val userInfo = Arguments.createMap()
|
|
39
39
|
val cause = error.data.cause?.message
|
|
40
40
|
if (!cause.isNullOrEmpty()) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
package ch.procivis.one.core.ubiqu
|
|
2
2
|
|
|
3
|
-
import ch.procivis.one.core.
|
|
3
|
+
import ch.procivis.one.core.GeneratedKey
|
|
4
4
|
import ch.procivis.one.core.NativeKeyStorage
|
|
5
5
|
import ch.procivis.one.core.NativeKeyStorageException
|
|
6
6
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
@@ -12,7 +12,7 @@ class UbiquKeyStorage(private val context: ReactApplicationContext) : NativeKeyS
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// ==== NativeKeyStorage interface
|
|
15
|
-
override suspend fun generateKey(keyAlias: String):
|
|
15
|
+
override suspend fun generateKey(keyAlias: String): GeneratedKey {
|
|
16
16
|
throw NativeKeyStorageException.Unsupported()
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -24,7 +24,7 @@ class UbiquKeyStorage(private val context: ReactApplicationContext) : NativeKeyS
|
|
|
24
24
|
throw NativeKeyStorageException.Unsupported()
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
override suspend fun generateAttestationKey(keyAlias: String, nonce: String?):
|
|
27
|
+
override suspend fun generateAttestationKey(keyAlias: String, nonce: String?): GeneratedKey {
|
|
28
28
|
throw NativeKeyStorageException.Unsupported()
|
|
29
29
|
}
|
|
30
30
|
|
package/core-sdk.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"android": {
|
|
3
3
|
"debug": {
|
|
4
|
-
"url": "https://onesdk.blob.core.windows.net/core-sdk/
|
|
5
|
-
"sha1": "
|
|
4
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/98296/android/onecore-debug.aar",
|
|
5
|
+
"sha1": "bda9f1358e75339000787c79cf5fa20bffe012ad"
|
|
6
6
|
},
|
|
7
7
|
"release": {
|
|
8
|
-
"url": "https://onesdk.blob.core.windows.net/core-sdk/
|
|
9
|
-
"sha1": "
|
|
8
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/98296/android/onecore-release.aar",
|
|
9
|
+
"sha1": "76b4d21931d5079b95d0a9ec780ec9b7ef4bd4cf"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"ios": {
|
|
13
|
-
"url": "https://onesdk.blob.core.windows.net/core-sdk/
|
|
14
|
-
"sha1": "
|
|
13
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/98296/ios/deploy.zip",
|
|
14
|
+
"sha1": "7b3cdd3c5192e99b7a906cd0d10311f20f539b5d"
|
|
15
15
|
}
|
|
16
16
|
}
|