@procivis/react-native-one-core 1.58802.0 → 1.67952.1
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/README.md +1 -1
- package/android/build.gradle +4 -3
- package/android/build.gradle_opensource +4 -3
- package/android/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +117 -17
- package/android/src/main/java/ch/procivis/one/core/SerializeSpecific.kt +63 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt +12 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt_opensource +12 -0
- package/core-sdk.json +6 -6
- package/dist/src/config.d.ts +7 -4
- package/dist/src/config.js +3 -1
- package/dist/src/core.d.ts +46 -8
- package/dist/src/core.js +5 -0
- package/dist/src/credential.d.ts +20 -13
- package/dist/src/credentialSchema.d.ts +2 -1
- package/dist/src/credentialSchema.js +1 -0
- package/dist/src/history.d.ts +2 -0
- package/dist/src/identifier.d.ts +1 -1
- package/dist/src/nfc.d.ts +6 -0
- package/dist/src/nfc.js +3 -0
- package/dist/src/proof.d.ts +54 -4
- package/dist/src/trust.d.ts +8 -3
- package/dist/src/walletUnit.d.ts +9 -1
- package/dist/src/walletUnit.js +2 -0
- package/ios/ProcivisOneCoreModule.m +21 -3
- package/ios/ProcivisOneCoreModule.swift +87 -16
- package/ios/RSEKeyStorage.swift +13 -1
- package/ios/RSEKeyStorage.swift_opensource +12 -0
- package/ios/Serialize.swift +42 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -162,7 +162,7 @@ Support for the recently published [FIPS-204][fips] is planned for the near futu
|
|
|
162
162
|
- [OID4VP over BLE][ble]; optimized version of Draft 00
|
|
163
163
|
- OID4VP over MQTT; proprietary adaptation of "OID4VP over BLE" via MQTT channel
|
|
164
164
|
- ISO/IEC 18013
|
|
165
|
-
- [18013-5][iso5]:
|
|
165
|
+
- [18013-5][iso5]: Device engagement using either NFC or QR Code, data retrieval using BLE
|
|
166
166
|
- [18013-7][iso7]: Online data retrieval via OID4VP
|
|
167
167
|
|
|
168
168
|
### Key storage
|
package/android/build.gradle
CHANGED
|
@@ -70,9 +70,10 @@ dependencies {
|
|
|
70
70
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
|
|
71
71
|
implementation 'com.facebook.react:react-native:+'
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
implementation 'net.java.dev.jna:jna:5.
|
|
73
|
+
releaseApi(name: 'onecore-release', ext: 'aar')
|
|
74
|
+
debugApi(name: 'onecore-debug', ext: 'aar')
|
|
75
|
+
implementation 'net.java.dev.jna:jna:5.17.0@aar'
|
|
76
|
+
implementation 'org.greenrobot:eventbus:3.3.1'
|
|
76
77
|
implementation("org.jetbrains.kotlin:kotlin-reflect:${safeExtGet('kotlinVersion', '1.9.0')}")
|
|
77
78
|
|
|
78
79
|
implementation(name: 'core-reactnative-compatible-2025.0305.1', ext: 'aar')
|
|
@@ -70,9 +70,10 @@ dependencies {
|
|
|
70
70
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
|
|
71
71
|
implementation 'com.facebook.react:react-native:+'
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
implementation 'net.java.dev.jna:jna:5.
|
|
73
|
+
releaseApi(name: 'onecore-release', ext: 'aar')
|
|
74
|
+
debugApi(name: 'onecore-debug', ext: 'aar')
|
|
75
|
+
implementation 'net.java.dev.jna:jna:5.17.0@aar'
|
|
76
|
+
implementation 'org.greenrobot:eventbus:3.3.1'
|
|
76
77
|
implementation("org.jetbrains.kotlin:kotlin-reflect:${safeExtGet('kotlinVersion', '1.9.0')}")
|
|
77
78
|
}
|
|
78
79
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
package ch.procivis.one.core
|
|
2
2
|
|
|
3
|
+
import ch.procivis.one.core.nfc.HCE as NfcHCE
|
|
4
|
+
import ch.procivis.one.core.nfc.Scanner as NfcScanner
|
|
3
5
|
import ch.procivis.one.core.Deserialize.construct
|
|
4
6
|
import ch.procivis.one.core.DeserializeSpecific.enumList
|
|
5
7
|
import ch.procivis.one.core.Serialize.convertToRN
|
|
@@ -20,6 +22,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
20
22
|
override fun getName() = "ProcivisOneCoreModule"
|
|
21
23
|
|
|
22
24
|
private var oneCore: OneCoreBindingInterface? = null
|
|
25
|
+
private var nfcHce: NfcHce = NfcHCE(reactContext)
|
|
23
26
|
private val scope = CoroutineScope(EmptyCoroutineContext)
|
|
24
27
|
|
|
25
28
|
private fun getCore(): OneCoreBindingInterface {
|
|
@@ -46,16 +49,21 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
46
49
|
@ReactMethod
|
|
47
50
|
fun initialize(configJson: String, promise: Promise) {
|
|
48
51
|
syncCall(promise) {
|
|
49
|
-
val
|
|
50
|
-
|
|
52
|
+
val context = this.reactApplicationContext
|
|
53
|
+
val dataDirPath = context.filesDir.absolutePath
|
|
54
|
+
ubiqu = ubiqu ?: UbiquKeyStorage(context)
|
|
51
55
|
oneCore =
|
|
52
56
|
initializeCore(
|
|
53
|
-
configJson = configJson,
|
|
54
57
|
dataDirPath = dataDirPath,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
params = InitParamsDto(
|
|
59
|
+
configJson = configJson,
|
|
60
|
+
nativeSecureElement = AndroidKeyStoreKeyStorage(context),
|
|
61
|
+
remoteSecureElement = ubiqu,
|
|
62
|
+
bleCentral = AndroidBLECentral(context),
|
|
63
|
+
blePeripheral = AndroidBLEPeripheral(context),
|
|
64
|
+
nfcHce = nfcHce,
|
|
65
|
+
nfcScanner = NfcScanner(context) { context.currentActivity }
|
|
66
|
+
)
|
|
59
67
|
)
|
|
60
68
|
return@syncCall null
|
|
61
69
|
}
|
|
@@ -197,8 +205,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
197
205
|
promise: Promise
|
|
198
206
|
) {
|
|
199
207
|
asyncCall(promise, scope) {
|
|
200
|
-
getCore().holderAcceptCredential(interactionId, didId, identifierId, keyId, txCode)
|
|
201
|
-
return@asyncCall null
|
|
208
|
+
return@asyncCall getCore().holderAcceptCredential(interactionId, didId, identifierId, keyId, txCode)
|
|
202
209
|
}
|
|
203
210
|
}
|
|
204
211
|
|
|
@@ -234,6 +241,14 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
234
241
|
}
|
|
235
242
|
}
|
|
236
243
|
|
|
244
|
+
@ReactMethod
|
|
245
|
+
fun getPresentationDefinitionV2(proofId: String, promise: Promise) {
|
|
246
|
+
asyncCall(promise, scope) {
|
|
247
|
+
val presentationDefinition = getCore().getPresentationDefinitionV2(proofId)
|
|
248
|
+
return@asyncCall convertToRN(presentationDefinition)
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
237
252
|
@ReactMethod
|
|
238
253
|
fun holderRejectProof(interactionId: String, promise: Promise) {
|
|
239
254
|
asyncCall(promise, scope) {
|
|
@@ -253,12 +268,75 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
253
268
|
) {
|
|
254
269
|
asyncCall(promise, scope) {
|
|
255
270
|
val submitCredentials =
|
|
256
|
-
mutableMapOf<String, PresentationSubmitCredentialRequestBindingDto
|
|
271
|
+
mutableMapOf<String, List<PresentationSubmitCredentialRequestBindingDto>>()
|
|
257
272
|
for (entry in credentials.entryIterator) {
|
|
258
|
-
val
|
|
259
|
-
|
|
273
|
+
val credentialList = when (val credentialValue = entry.value) {
|
|
274
|
+
is ReadableMap -> {
|
|
275
|
+
// Single credential object - convert to list
|
|
276
|
+
listOf(construct<PresentationSubmitCredentialRequestBindingDto>(credentialValue))
|
|
277
|
+
}
|
|
278
|
+
is ReadableArray -> {
|
|
279
|
+
// Array of credentials - convert each one
|
|
280
|
+
(0 until credentialValue.size()).map { index ->
|
|
281
|
+
construct<PresentationSubmitCredentialRequestBindingDto>(credentialValue.getMap(index)!!)
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
else -> {
|
|
285
|
+
throw IllegalArgumentException("Credential value must be either a Map or Array")
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
submitCredentials[entry.key] = credentialList
|
|
260
289
|
}
|
|
261
|
-
getCore().holderSubmitProof(
|
|
290
|
+
getCore().holderSubmitProof(
|
|
291
|
+
interactionId,
|
|
292
|
+
submitCredentials,
|
|
293
|
+
didId,
|
|
294
|
+
identifierId,
|
|
295
|
+
keyId
|
|
296
|
+
)
|
|
297
|
+
return@asyncCall null
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
@ReactMethod
|
|
302
|
+
fun holderSubmitProofV2(
|
|
303
|
+
interactionId: String,
|
|
304
|
+
credentials: ReadableMap,
|
|
305
|
+
promise: Promise
|
|
306
|
+
) {
|
|
307
|
+
asyncCall(promise, scope) {
|
|
308
|
+
val submission =
|
|
309
|
+
mutableMapOf<String, List<PresentationSubmitV2CredentialRequestBindingDto>>()
|
|
310
|
+
for (entry in credentials.entryIterator) {
|
|
311
|
+
val credentialList = when (val credentialValue = entry.value) {
|
|
312
|
+
is ReadableMap -> {
|
|
313
|
+
// Single credential object - convert to list
|
|
314
|
+
listOf(
|
|
315
|
+
construct<PresentationSubmitV2CredentialRequestBindingDto>(
|
|
316
|
+
credentialValue
|
|
317
|
+
)
|
|
318
|
+
)
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
is ReadableArray -> {
|
|
322
|
+
// Array of credentials - convert each one
|
|
323
|
+
(0 until credentialValue.size()).map { index ->
|
|
324
|
+
construct<PresentationSubmitV2CredentialRequestBindingDto>(
|
|
325
|
+
credentialValue.getMap(index)!!
|
|
326
|
+
)
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
else -> {
|
|
331
|
+
throw IllegalArgumentException("Credential value must be either a Map or Array")
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
submission[entry.key] = credentialList
|
|
335
|
+
}
|
|
336
|
+
getCore().holderSubmitProofV2(
|
|
337
|
+
interactionId,
|
|
338
|
+
submission
|
|
339
|
+
)
|
|
262
340
|
return@asyncCall null
|
|
263
341
|
}
|
|
264
342
|
}
|
|
@@ -358,9 +436,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
358
436
|
}
|
|
359
437
|
|
|
360
438
|
@ReactMethod
|
|
361
|
-
fun proposeProof(
|
|
439
|
+
fun proposeProof(request: ReadableMap, promise: Promise) {
|
|
362
440
|
asyncCall(promise, scope) {
|
|
363
|
-
val result = getCore().proposeProof(
|
|
441
|
+
val result = getCore().proposeProof(construct(request))
|
|
364
442
|
return@asyncCall convertToRN(result)
|
|
365
443
|
}
|
|
366
444
|
}
|
|
@@ -588,8 +666,8 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
588
666
|
@ReactMethod
|
|
589
667
|
fun holderRegisterWalletUnit(request: ReadableMap, promise: Promise) {
|
|
590
668
|
asyncCall(promise, scope) {
|
|
591
|
-
getCore().holderRegisterWalletUnit(construct(request))
|
|
592
|
-
return@asyncCall
|
|
669
|
+
val result = getCore().holderRegisterWalletUnit(construct(request))
|
|
670
|
+
return@asyncCall convertToRN(result)
|
|
593
671
|
}
|
|
594
672
|
}
|
|
595
673
|
|
|
@@ -609,6 +687,21 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
609
687
|
}
|
|
610
688
|
}
|
|
611
689
|
|
|
690
|
+
@ReactMethod
|
|
691
|
+
fun nfcReadIsoMdlEngagement(request: ReadableMap, promise: Promise) {
|
|
692
|
+
asyncCall(promise, scope) {
|
|
693
|
+
return@asyncCall getCore().nfcReadIsoMdlEngagement(construct(request))
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
@ReactMethod
|
|
698
|
+
fun nfcStopIsoMdlEngagement(promise: Promise) {
|
|
699
|
+
asyncCall(promise, scope) {
|
|
700
|
+
getCore().nfcStopIsoMdlEngagement()
|
|
701
|
+
return@asyncCall null
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
612
705
|
@ReactMethod
|
|
613
706
|
fun uninitialize(deleteData: Boolean, promise: Promise) {
|
|
614
707
|
asyncCall(promise, scope) {
|
|
@@ -621,6 +714,13 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
621
714
|
}
|
|
622
715
|
}
|
|
623
716
|
|
|
717
|
+
@ReactMethod
|
|
718
|
+
fun isNfcHceSupported(promise: Promise) {
|
|
719
|
+
asyncCall(promise, scope) {
|
|
720
|
+
return@asyncCall nfcHce.isSupported()
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
624
724
|
// ===== Ubiqu specific methods
|
|
625
725
|
@ReactMethod
|
|
626
726
|
fun changeRSEPin(promise: Promise) {
|
|
@@ -12,6 +12,8 @@ object SerializeSpecific {
|
|
|
12
12
|
HistoryMetadataBinding::class.java,
|
|
13
13
|
ClaimBindingDto::class.java,
|
|
14
14
|
ProofRequestClaimBindingDto::class.java,
|
|
15
|
+
CredentialQueryResponseBindingDto::class.java,
|
|
16
|
+
PresentationDefinitionV2ClaimBindingDto::class.java
|
|
15
17
|
)
|
|
16
18
|
|
|
17
19
|
fun isCustomConversionType(input: Any?): Boolean {
|
|
@@ -33,6 +35,12 @@ object SerializeSpecific {
|
|
|
33
35
|
if (input is ProofRequestClaimBindingDto) {
|
|
34
36
|
return proofClaim(input)
|
|
35
37
|
}
|
|
38
|
+
if (input is CredentialQueryResponseBindingDto) {
|
|
39
|
+
return credentialQuery(input)
|
|
40
|
+
}
|
|
41
|
+
if (input is PresentationDefinitionV2ClaimBindingDto) {
|
|
42
|
+
return presentationDefinitionV2Claim(input)
|
|
43
|
+
}
|
|
36
44
|
throw IllegalArgumentException("Invalid map conversion: $input")
|
|
37
45
|
}
|
|
38
46
|
|
|
@@ -53,6 +61,22 @@ object SerializeSpecific {
|
|
|
53
61
|
}
|
|
54
62
|
}
|
|
55
63
|
|
|
64
|
+
private fun credentialQuery(dto: CredentialQueryResponseBindingDto): ReadableMap {
|
|
65
|
+
val result = Arguments.createMap()
|
|
66
|
+
result.putBoolean("multiple", dto.multiple)
|
|
67
|
+
when (val value = dto.credentialOrFailureHint) {
|
|
68
|
+
is ApplicableCredentialOrFailureHintBindingEnum.ApplicableCredentials -> result.putArray(
|
|
69
|
+
"applicableCredentials",
|
|
70
|
+
convertToRN(value.applicableCredentials) as ReadableArray
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
is ApplicableCredentialOrFailureHintBindingEnum.FailureHint -> {
|
|
74
|
+
result.putMap("failureHint", convertToRN(value.failureHint) as ReadableMap)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return result
|
|
78
|
+
}
|
|
79
|
+
|
|
56
80
|
private fun claim(c: ClaimBindingDto): ReadableMap {
|
|
57
81
|
val result = Arguments.createMap()
|
|
58
82
|
result.putString("id", c.id)
|
|
@@ -70,6 +94,7 @@ object SerializeSpecific {
|
|
|
70
94
|
result.putInt("value", value.value.toInt())
|
|
71
95
|
}
|
|
72
96
|
}
|
|
97
|
+
|
|
73
98
|
is ClaimValueBindingDto.String -> result.putString("value", value.value)
|
|
74
99
|
is ClaimValueBindingDto.Nested ->
|
|
75
100
|
result.putArray("value", convertToRN(value.value) as ReadableArray)
|
|
@@ -94,6 +119,44 @@ object SerializeSpecific {
|
|
|
94
119
|
|
|
95
120
|
return result
|
|
96
121
|
}
|
|
122
|
+
|
|
123
|
+
private fun presentationDefinitionV2Claim(c: PresentationDefinitionV2ClaimBindingDto): ReadableMap {
|
|
124
|
+
val result = Arguments.createMap()
|
|
125
|
+
result.putString("path", c.path)
|
|
126
|
+
result.putMap("schema", convertToRN(c.schema) as ReadableMap)
|
|
127
|
+
result.putBoolean("userSelection", c.userSelection)
|
|
128
|
+
result.putBoolean("required", c.required)
|
|
129
|
+
|
|
130
|
+
when (val value = c.value) {
|
|
131
|
+
is PresentationDefinitionV2ClaimValueBindingDto.Boolean -> result.putBoolean(
|
|
132
|
+
"value",
|
|
133
|
+
value.value
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
is PresentationDefinitionV2ClaimValueBindingDto.Float -> result.putDouble(
|
|
137
|
+
"value",
|
|
138
|
+
value.value
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
is PresentationDefinitionV2ClaimValueBindingDto.Integer -> {
|
|
142
|
+
if (value.value < Int.MIN_VALUE || value.value > Int.MAX_VALUE) {
|
|
143
|
+
result.putDouble("value", value.value.toDouble())
|
|
144
|
+
} else {
|
|
145
|
+
result.putInt("value", value.value.toInt())
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
is PresentationDefinitionV2ClaimValueBindingDto.String -> result.putString(
|
|
150
|
+
"value",
|
|
151
|
+
value.value
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
is PresentationDefinitionV2ClaimValueBindingDto.Nested ->
|
|
155
|
+
result.putArray("value", convertToRN(value.value) as ReadableArray)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return result
|
|
159
|
+
}
|
|
97
160
|
}
|
|
98
161
|
|
|
99
162
|
object Str {
|
|
@@ -110,6 +110,18 @@ class UbiquKeyStorage(private val context: ReactApplicationContext) : NativeKeyS
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
override suspend fun generateAttestation(keyReference: ByteArray, nonce: String?): List<String> {
|
|
114
|
+
throw NativeKeyStorageException.Unsupported()
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
override suspend fun signWithAttestationKey(keyReference: ByteArray, message: ByteArray): ByteArray {
|
|
118
|
+
throw NativeKeyStorageException.Unsupported()
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
override suspend fun generateAttestationKey(keyAlias: String, nonce: String?): GeneratedKeyBindingDto {
|
|
122
|
+
throw NativeKeyStorageException.Unsupported()
|
|
123
|
+
}
|
|
124
|
+
|
|
113
125
|
// ==== public interface
|
|
114
126
|
suspend fun changePin(): String? {
|
|
115
127
|
return exceptionWrapper {
|
|
@@ -20,6 +20,18 @@ class UbiquKeyStorage(private val context: ReactApplicationContext) : NativeKeyS
|
|
|
20
20
|
throw NativeKeyStorageException.Unsupported()
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
override suspend fun generateAttestation(keyReference: ByteArray, nonce: String?): List<String> {
|
|
24
|
+
throw NativeKeyStorageException.Unsupported()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
override suspend fun generateAttestationKey(keyAlias: String, nonce: String?): GeneratedKeyBindingDto {
|
|
28
|
+
throw NativeKeyStorageException.Unsupported()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
override suspend fun signWithAttestationKey(keyReference: ByteArray, message: ByteArray): ByteArray {
|
|
32
|
+
throw NativeKeyStorageException.Unsupported()
|
|
33
|
+
}
|
|
34
|
+
|
|
23
35
|
// ==== public interface
|
|
24
36
|
fun changePin(): String? {
|
|
25
37
|
throw NativeKeyStorageException.Unsupported()
|
package/core-sdk.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"android": {
|
|
3
3
|
"debug": {
|
|
4
|
-
"url": "https://
|
|
5
|
-
"sha1": "
|
|
4
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/67952/android/onecore-debug.aar",
|
|
5
|
+
"sha1": "18023ed5e0e3b38249cff431a20c25b6e179390f"
|
|
6
6
|
},
|
|
7
7
|
"release": {
|
|
8
|
-
"url": "https://
|
|
9
|
-
"sha1": "
|
|
8
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/67952/android/onecore-release.aar",
|
|
9
|
+
"sha1": "8f8c1133d953ea827a7fe81b3bf2715188931fcc"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"ios": {
|
|
13
|
-
"url": "https://
|
|
14
|
-
"sha1": "
|
|
13
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/67952/ios/deploy.zip",
|
|
14
|
+
"sha1": "0b2637eddebc58b5972276b2143e34312a2bd01a"
|
|
15
15
|
}
|
|
16
16
|
}
|
package/dist/src/config.d.ts
CHANGED
|
@@ -71,9 +71,11 @@ export declare enum DataTypeEnum {
|
|
|
71
71
|
String = "STRING",
|
|
72
72
|
Number = "NUMBER",
|
|
73
73
|
Date = "DATE",
|
|
74
|
-
|
|
74
|
+
Picture = "PICTURE",
|
|
75
|
+
SwiyuPicture = "SWIYU_PICTURE",
|
|
75
76
|
Boolean = "BOOLEAN",
|
|
76
|
-
Object = "OBJECT"
|
|
77
|
+
Object = "OBJECT",
|
|
78
|
+
Array = "ARRAY"
|
|
77
79
|
}
|
|
78
80
|
type DataTypeError = string | Record<string, string>;
|
|
79
81
|
export interface StringDataTypeParams {
|
|
@@ -107,10 +109,10 @@ export type DataTypeParams = {
|
|
|
107
109
|
type: DataTypeEnum.Date;
|
|
108
110
|
params?: DateDataTypeParams;
|
|
109
111
|
} | {
|
|
110
|
-
type: DataTypeEnum.
|
|
112
|
+
type: DataTypeEnum.Picture | DataTypeEnum.SwiyuPicture;
|
|
111
113
|
params?: FileDataTypeParams;
|
|
112
114
|
} | {
|
|
113
|
-
type: DataTypeEnum.Object;
|
|
115
|
+
type: DataTypeEnum.Object | DataTypeEnum.Array | DataTypeEnum.Boolean;
|
|
114
116
|
params?: undefined;
|
|
115
117
|
};
|
|
116
118
|
export declare enum IssuanceProtocolFeatureEnum {
|
|
@@ -146,5 +148,6 @@ export interface Config {
|
|
|
146
148
|
cacheEntities: ConfigEntities;
|
|
147
149
|
task: ConfigEntities;
|
|
148
150
|
credentialIssuer: ConfigEntities<undefined, {}>;
|
|
151
|
+
walletProvider: ConfigEntities;
|
|
149
152
|
}
|
|
150
153
|
export {};
|
package/dist/src/config.js
CHANGED
|
@@ -38,9 +38,11 @@ export var DataTypeEnum;
|
|
|
38
38
|
DataTypeEnum["String"] = "STRING";
|
|
39
39
|
DataTypeEnum["Number"] = "NUMBER";
|
|
40
40
|
DataTypeEnum["Date"] = "DATE";
|
|
41
|
-
DataTypeEnum["
|
|
41
|
+
DataTypeEnum["Picture"] = "PICTURE";
|
|
42
|
+
DataTypeEnum["SwiyuPicture"] = "SWIYU_PICTURE";
|
|
42
43
|
DataTypeEnum["Boolean"] = "BOOLEAN";
|
|
43
44
|
DataTypeEnum["Object"] = "OBJECT";
|
|
45
|
+
DataTypeEnum["Array"] = "ARRAY";
|
|
44
46
|
})(DataTypeEnum || (DataTypeEnum = {}));
|
|
45
47
|
export var IssuanceProtocolFeatureEnum;
|
|
46
48
|
(function (IssuanceProtocolFeatureEnum) {
|
package/dist/src/core.d.ts
CHANGED
|
@@ -6,13 +6,14 @@ import { DidListItem, DidListQuery, DidRequest } from "./did";
|
|
|
6
6
|
import { HistoryListItem, HistoryListQuery } from "./history";
|
|
7
7
|
import { KeyRequest } from "./key";
|
|
8
8
|
import { ItemList } from "./list";
|
|
9
|
-
import { CreateProofRequest, InvitationResultProofRequest, PresentationDefinition, PresentationDefinitionRequestedCredential, PresentationSubmitCredentialRequest, ProofDetail, ProofListItem, ProofListQuery, ProposeProofResponse, ShareProofRequest, ShareProofResponse } from "./proof";
|
|
9
|
+
import { CreateProofRequest, InvitationResultProofRequest, PresentationDefinition, PresentationDefinitionRequestedCredential, PresentationDefinitionV2, PresentationSubmitCredentialRequest, PresentationSubmitV2CredentialRequest, ProofDetail, ProofListItem, ProofListQuery, ProposeProofRequest, ProposeProofResponse, ShareProofRequest, ShareProofResponse } from "./proof";
|
|
10
10
|
import { CreateProofSchemaRequest, ImportProofSchemaRequest, ProofSchema, ProofSchemaListItem, ProofSchemaListQuery, ShareProofSchemaResponse } from "./proofSchema";
|
|
11
11
|
import { CreateRemoteTrustEntityRequest, CreateTrustAnchorRequest, CreateTrustEntityRequest, RemoteTrustEntity, ResolvedIdentifierTrustEntity, ResolveTrustEntityByIdentifierRequest, TrustAnchor, TrustAnchorListItem, TrustAnchorListQuery, TrustEntity, TrustEntityListItem, TrustEntityListQuery, UpdateRemoteTrustEntityRequest } from "./trust";
|
|
12
12
|
import { CacheType } from "./cache";
|
|
13
13
|
import { CreateOrganisationRequest, UpsertOrganisationRequest } from "./organisation";
|
|
14
14
|
import { CreateIdentifierRequest, IdentifierDetail, IdentifierListItem, IdentifierListQuery } from "./identifier";
|
|
15
|
-
import { HolderAttestationWalletUnitResponse, HolderRefreshWalletUnitRequest, HolderRegisterWalletUnitRequest } from "./walletUnit";
|
|
15
|
+
import { HolderAttestationWalletUnitResponse, HolderRefreshWalletUnitRequest, HolderRegisterWalletUnitRequest, HolderRegisterWalletUnitResponse } from "./walletUnit";
|
|
16
|
+
import { NfcScanRequest } from "./nfc";
|
|
16
17
|
export * from "./backup";
|
|
17
18
|
export * from "./cache";
|
|
18
19
|
export * from "./config";
|
|
@@ -22,6 +23,7 @@ export * from "./did";
|
|
|
22
23
|
export * from "./identifier";
|
|
23
24
|
export * from "./history";
|
|
24
25
|
export * from "./key";
|
|
26
|
+
export * from "./nfc";
|
|
25
27
|
export * from "./list";
|
|
26
28
|
export * from "./organisation";
|
|
27
29
|
export * from "./proof";
|
|
@@ -39,9 +41,18 @@ export interface Version {
|
|
|
39
41
|
}
|
|
40
42
|
export type InvitationResult = InvitationResultCredentialIssuance | InvitationResultProofRequest | AuthorizationCodeFlow;
|
|
41
43
|
export interface HandleInvitationRequest {
|
|
44
|
+
/** Typically encoded as a QR code or deep link by the issuer or
|
|
45
|
+
* verifier. For example:
|
|
46
|
+
* "https://example.com/credential-offer" */
|
|
42
47
|
url: string;
|
|
43
48
|
organisationId: string;
|
|
49
|
+
/** For configurations with multiple transport protocols enabled
|
|
50
|
+
* you can specify which one to use for this interaction. */
|
|
44
51
|
transport?: string[];
|
|
52
|
+
/** For issuer-initiated Authorization Code Flows, provide the
|
|
53
|
+
* authorization server with the URI it should return the user
|
|
54
|
+
* to once authorization is complete. For example:
|
|
55
|
+
* "myapp://example". */
|
|
45
56
|
redirectUri?: string;
|
|
46
57
|
}
|
|
47
58
|
export interface ResolveJsonLdContextResponse {
|
|
@@ -59,18 +70,29 @@ export interface ONECore {
|
|
|
59
70
|
getIdentifiers(query: IdentifierListQuery): Promise<ItemList<IdentifierListItem>>;
|
|
60
71
|
getIdentifier(identifierId: IdentifierListItem["id"]): Promise<IdentifierDetail>;
|
|
61
72
|
deleteIdentifier(identifierId: IdentifierListItem["id"]): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* For a wallet, handles the interaction once the wallet connects to a share
|
|
75
|
+
* endpoint URL (for example, scans the QR code of an offered credential or
|
|
76
|
+
* request for proof).
|
|
77
|
+
*/
|
|
62
78
|
handleInvitation(request: HandleInvitationRequest): Promise<InvitationResult>;
|
|
63
|
-
holderAcceptCredential(interactionId: InvitationResultCredentialIssuance["interactionId"], didId: DidListItem["id"] | undefined, identifierId: IdentifierListItem["id"] | undefined, keyId: string | undefined, txCode: string | undefined): Promise<
|
|
79
|
+
holderAcceptCredential(interactionId: InvitationResultCredentialIssuance["interactionId"], didId: DidListItem["id"] | undefined, identifierId: IdentifierListItem["id"] | undefined, keyId: string | undefined, txCode: string | undefined): Promise<CredentialDetail["id"]>;
|
|
64
80
|
holderRejectCredential(interactionId: InvitationResultCredentialIssuance["interactionId"]): Promise<void>;
|
|
65
81
|
/** For wallets, starts the OID4VCI Authorization Code Flow. */
|
|
66
82
|
initiateIssuance(request: InitiateIssuanceRequest): Promise<InitiateIssuanceResponse>;
|
|
67
83
|
/** For wallet-initiated flows, continues the OpenID4VCI issuance process
|
|
68
84
|
* after completing authorization.
|
|
69
85
|
*/
|
|
70
|
-
continueIssuance(
|
|
86
|
+
continueIssuance(
|
|
87
|
+
/** Starts with the `redirectUri` and is used to continue the Authorization
|
|
88
|
+
* Code Flow issuance process. For example:
|
|
89
|
+
* "myapp://example/credential-offer?code=xxx&clientId=myWallet&..." */
|
|
90
|
+
url: string): Promise<ContinueIssuanceResponse>;
|
|
71
91
|
getPresentationDefinition(proofId: ProofDetail["id"]): Promise<PresentationDefinition>;
|
|
92
|
+
getPresentationDefinitionV2(proofId: ProofDetail["id"]): Promise<PresentationDefinitionV2>;
|
|
72
93
|
holderRejectProof(interactionId: InvitationResultProofRequest["interactionId"]): Promise<void>;
|
|
73
|
-
holderSubmitProof(interactionId: InvitationResultProofRequest["interactionId"], credentials: Record<PresentationDefinitionRequestedCredential["id"], PresentationSubmitCredentialRequest>, didId: DidListItem["id"] | undefined, identifierId: IdentifierListItem["id"] | undefined, keyId: string | undefined): Promise<void>;
|
|
94
|
+
holderSubmitProof(interactionId: InvitationResultProofRequest["interactionId"], credentials: Record<PresentationDefinitionRequestedCredential["id"], PresentationSubmitCredentialRequest | PresentationSubmitCredentialRequest[]>, didId: DidListItem["id"] | undefined, identifierId: IdentifierListItem["id"] | undefined, keyId: string | undefined): Promise<void>;
|
|
95
|
+
holderSubmitProofV2(interactionId: InvitationResultProofRequest["interactionId"], credentials: Record<string, PresentationSubmitV2CredentialRequest | PresentationSubmitV2CredentialRequest[]>): Promise<void>;
|
|
74
96
|
getCredentials(query: CredentialListQuery): Promise<ItemList<CredentialListItem>>;
|
|
75
97
|
runTask(task: string): Promise<string>;
|
|
76
98
|
deleteProofClaims(proofId: ProofDetail["id"]): Promise<void>;
|
|
@@ -80,6 +102,7 @@ export interface ONECore {
|
|
|
80
102
|
getCredentialSchema(credentialSchemaId: CredentialSchema["id"]): Promise<CredentialSchemaDetail>;
|
|
81
103
|
getCredentialSchemas(query: CredentialSchemaListQuery): Promise<ItemList<CredentialSchema>>;
|
|
82
104
|
deleteCredentialSchema(credentialSchemaId: CredentialSchema["id"]): Promise<void>;
|
|
105
|
+
/** For verifiers, creates a proof request. */
|
|
83
106
|
createProof(request: CreateProofRequest): Promise<ProofDetail["id"]>;
|
|
84
107
|
shareProof(proofId: ProofDetail["id"], request: ShareProofRequest): Promise<ShareProofResponse>;
|
|
85
108
|
shareProofSchema(proofSchemaId: ProofSchema["id"]): Promise<ShareProofSchemaResponse>;
|
|
@@ -87,7 +110,11 @@ export interface ONECore {
|
|
|
87
110
|
getProof(proofId: ProofDetail["id"]): Promise<ProofDetail>;
|
|
88
111
|
getProofs(query: ProofListQuery): Promise<ItemList<ProofListItem>>;
|
|
89
112
|
deleteProof(proofId: ProofDetail["id"]): Promise<void>;
|
|
90
|
-
|
|
113
|
+
/** For wallets, initiates device engagement for offline flows.
|
|
114
|
+
* Reference the `verificationEngagement` entry of your configuration
|
|
115
|
+
* for your options for `engagement`.
|
|
116
|
+
*/
|
|
117
|
+
proposeProof(request: ProposeProofRequest): Promise<ProposeProofResponse>;
|
|
91
118
|
createProofSchema(request: CreateProofSchemaRequest): Promise<ProofSchema["id"]>;
|
|
92
119
|
getProofSchemas(query: ProofSchemaListQuery): Promise<ItemList<ProofSchemaListItem>>;
|
|
93
120
|
getProofSchema(proofSchemaId: ProofSchema["id"]): Promise<ProofSchema>;
|
|
@@ -133,9 +160,20 @@ export interface ONECore {
|
|
|
133
160
|
*/
|
|
134
161
|
rollbackImport(): Promise<void>;
|
|
135
162
|
resolveJsonldContext(url: string): Promise<ResolveJsonLdContextResponse>;
|
|
136
|
-
holderRegisterWalletUnit(request: HolderRegisterWalletUnitRequest): Promise<
|
|
163
|
+
holderRegisterWalletUnit(request: HolderRegisterWalletUnitRequest): Promise<HolderRegisterWalletUnitResponse>;
|
|
137
164
|
holderRefreshWalletUnit(request: HolderRefreshWalletUnitRequest): Promise<void>;
|
|
138
165
|
holderGetWalletUnitAttestation(organisationId: string): Promise<HolderAttestationWalletUnitResponse>;
|
|
166
|
+
/**
|
|
167
|
+
* Start scanning for ISO 18013-5 NFC engagement
|
|
168
|
+
*
|
|
169
|
+
* @param {NfcScanRequest} request system overlay messages to be displayed (iOS only)
|
|
170
|
+
* @returns {string} encoded NFC engagement to be used for {@link CreateProofRequest.isoMdlEngagement}
|
|
171
|
+
*/
|
|
172
|
+
nfcReadIsoMdlEngagement(request: NfcScanRequest): Promise<string>;
|
|
173
|
+
/**
|
|
174
|
+
* Explicitly stop scan started via {@link nfcReadIsoMdlEngagement}
|
|
175
|
+
*/
|
|
176
|
+
nfcStopIsoMdlEngagement(): Promise<void>;
|
|
139
177
|
/**
|
|
140
178
|
* Uninitialize the core instance
|
|
141
179
|
*
|
|
@@ -145,4 +183,4 @@ export interface ONECore {
|
|
|
145
183
|
*/
|
|
146
184
|
uninitialize(deleteData: boolean): Promise<void>;
|
|
147
185
|
}
|
|
148
|
-
export declare const interfaceMethodNames: readonly ["getVersion", "getConfig", "createOrganisation", "upsertOrganisation", "generateKey", "createDid", "getDids", "createIdentifier", "getIdentifier", "getIdentifiers", "deleteIdentifier", "handleInvitation", "holderAcceptCredential", "holderRejectCredential", "initiateIssuance", "continueIssuance", "getPresentationDefinition", "holderRejectProof", "holderSubmitProof", "getCredentials", "runTask", "deleteProofClaims", "getCredential", "deleteCredential", "importCredentialSchema", "getCredentialSchema", "getCredentialSchemas", "deleteCredentialSchema", "createProof", "shareProof", "shareProofSchema", "shareCredentialSchema", "getProof", "getProofs", "deleteProof", "proposeProof", "createProofSchema", "getProofSchemas", "getProofSchema", "deleteProofSchema", "importProofSchema", "checkRevocation", "createTrustAnchor", "deleteTrustAnchor", "getTrustAnchor", "getTrustAnchors", "createTrustEntity", "getTrustEntity", "getTrustEntities", "getTrustEntityByDid", "resolveTrustEntityByIdentifier", "createRemoteTrustEntity", "getRemoteTrustEntity", "updateRemoteTrustEntity", "getHistory", "getHistoryEntry", "createBackup", "backupInfo", "deleteCache", "unpackBackup", "finalizeImport", "rollbackImport", "resolveJsonldContext", "holderRegisterWalletUnit", "holderRefreshWalletUnit", "holderGetWalletUnitAttestation", "uninitialize"];
|
|
186
|
+
export declare const interfaceMethodNames: readonly ["getVersion", "getConfig", "createOrganisation", "upsertOrganisation", "generateKey", "createDid", "getDids", "createIdentifier", "getIdentifier", "getIdentifiers", "deleteIdentifier", "handleInvitation", "holderAcceptCredential", "holderRejectCredential", "initiateIssuance", "continueIssuance", "getPresentationDefinition", "getPresentationDefinitionV2", "holderRejectProof", "holderSubmitProof", "holderSubmitProofV2", "getCredentials", "runTask", "deleteProofClaims", "getCredential", "deleteCredential", "importCredentialSchema", "getCredentialSchema", "getCredentialSchemas", "deleteCredentialSchema", "createProof", "shareProof", "shareProofSchema", "shareCredentialSchema", "getProof", "getProofs", "deleteProof", "proposeProof", "createProofSchema", "getProofSchemas", "getProofSchema", "deleteProofSchema", "importProofSchema", "checkRevocation", "createTrustAnchor", "deleteTrustAnchor", "getTrustAnchor", "getTrustAnchors", "createTrustEntity", "getTrustEntity", "getTrustEntities", "getTrustEntityByDid", "resolveTrustEntityByIdentifier", "createRemoteTrustEntity", "getRemoteTrustEntity", "updateRemoteTrustEntity", "getHistory", "getHistoryEntry", "createBackup", "backupInfo", "deleteCache", "unpackBackup", "finalizeImport", "rollbackImport", "resolveJsonldContext", "holderRegisterWalletUnit", "holderRefreshWalletUnit", "holderGetWalletUnitAttestation", "nfcReadIsoMdlEngagement", "nfcStopIsoMdlEngagement", "uninitialize"];
|
package/dist/src/core.js
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./did";
|
|
|
7
7
|
export * from "./identifier";
|
|
8
8
|
export * from "./history";
|
|
9
9
|
export * from "./key";
|
|
10
|
+
export * from "./nfc";
|
|
10
11
|
export * from "./list";
|
|
11
12
|
export * from "./organisation";
|
|
12
13
|
export * from "./proof";
|
|
@@ -32,8 +33,10 @@ export const interfaceMethodNames = [
|
|
|
32
33
|
"initiateIssuance",
|
|
33
34
|
"continueIssuance",
|
|
34
35
|
"getPresentationDefinition",
|
|
36
|
+
"getPresentationDefinitionV2",
|
|
35
37
|
"holderRejectProof",
|
|
36
38
|
"holderSubmitProof",
|
|
39
|
+
"holderSubmitProofV2",
|
|
37
40
|
"getCredentials",
|
|
38
41
|
"runTask",
|
|
39
42
|
"deleteProofClaims",
|
|
@@ -81,6 +84,8 @@ export const interfaceMethodNames = [
|
|
|
81
84
|
"holderRegisterWalletUnit",
|
|
82
85
|
"holderRefreshWalletUnit",
|
|
83
86
|
"holderGetWalletUnitAttestation",
|
|
87
|
+
"nfcReadIsoMdlEngagement",
|
|
88
|
+
"nfcStopIsoMdlEngagement",
|
|
84
89
|
"uninitialize",
|
|
85
90
|
];
|
|
86
91
|
// Typescript automatic assertions to keep ONECore and interfaceMethodNames in sync
|