@procivis/react-native-one-core 1.58802.0 → 1.60807.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/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]: QR code engagement and offline device retrieval over BLE
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
@@ -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
- releaseImplementation(name: 'onecore-release', ext: 'aar')
74
- debugImplementation(name: 'onecore-debug', ext: 'aar')
75
- implementation 'net.java.dev.jna:jna:5.13.0@aar'
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
- releaseImplementation(name: 'onecore-release', ext: 'aar')
74
- debugImplementation(name: 'onecore-debug', ext: 'aar')
75
- implementation 'net.java.dev.jna:jna:5.13.0@aar'
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
@@ -46,16 +48,21 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
46
48
  @ReactMethod
47
49
  fun initialize(configJson: String, promise: Promise) {
48
50
  syncCall(promise) {
49
- val dataDirPath = this.reactApplicationContext.filesDir.absolutePath
50
- ubiqu = ubiqu ?: UbiquKeyStorage(this.reactApplicationContext)
51
+ val context = this.reactApplicationContext
52
+ val dataDirPath = context.filesDir.absolutePath
53
+ ubiqu = ubiqu ?: UbiquKeyStorage(context)
51
54
  oneCore =
52
55
  initializeCore(
53
- configJson = configJson,
54
56
  dataDirPath = dataDirPath,
55
- nativeSecureElement = AndroidKeyStoreKeyStorage(this.reactApplicationContext),
56
- remoteSecureElement = ubiqu,
57
- bleCentral = AndroidBLECentral(this.reactApplicationContext),
58
- blePeripheral = AndroidBLEPeripheral(this.reactApplicationContext)
57
+ params = InitParamsDto(
58
+ configJson = configJson,
59
+ nativeSecureElement = AndroidKeyStoreKeyStorage(context),
60
+ remoteSecureElement = ubiqu,
61
+ bleCentral = AndroidBLECentral(context),
62
+ blePeripheral = AndroidBLEPeripheral(context),
63
+ nfcHce = NfcHCE(context),
64
+ nfcScanner = NfcScanner(context) { context.currentActivity }
65
+ )
59
66
  )
60
67
  return@syncCall null
61
68
  }
@@ -253,12 +260,32 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
253
260
  ) {
254
261
  asyncCall(promise, scope) {
255
262
  val submitCredentials =
256
- mutableMapOf<String, PresentationSubmitCredentialRequestBindingDto>()
263
+ mutableMapOf<String, List<PresentationSubmitCredentialRequestBindingDto>>()
257
264
  for (entry in credentials.entryIterator) {
258
- val credential = entry.value as ReadableMap
259
- submitCredentials[entry.key] = construct(credential)
265
+ val credentialList = when (val credentialValue = entry.value) {
266
+ is ReadableMap -> {
267
+ // Single credential object - convert to list
268
+ listOf(construct<PresentationSubmitCredentialRequestBindingDto>(credentialValue))
269
+ }
270
+ is ReadableArray -> {
271
+ // Array of credentials - convert each one
272
+ (0 until credentialValue.size()).map { index ->
273
+ construct<PresentationSubmitCredentialRequestBindingDto>(credentialValue.getMap(index)!!)
274
+ }
275
+ }
276
+ else -> {
277
+ throw IllegalArgumentException("Credential value must be either a Map or Array")
278
+ }
279
+ }
280
+ submitCredentials[entry.key] = credentialList
260
281
  }
261
- getCore().holderSubmitProof(interactionId, submitCredentials, didId, identifierId, keyId)
282
+ getCore().holderSubmitProof(
283
+ interactionId,
284
+ submitCredentials,
285
+ didId,
286
+ identifierId,
287
+ keyId
288
+ )
262
289
  return@asyncCall null
263
290
  }
264
291
  }
@@ -358,9 +385,10 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
358
385
  }
359
386
 
360
387
  @ReactMethod
361
- fun proposeProof(exchange: String, organisationId: String, promise: Promise) {
388
+ fun proposeProof(exchange: String, organisationId: String, engagement: ReadableArray, promise: Promise) {
362
389
  asyncCall(promise, scope) {
363
- val result = getCore().proposeProof(exchange, organisationId)
390
+ val engagement = DeserializeSpecific.ids(engagement)
391
+ val result = getCore().proposeProof(exchange, organisationId, engagement)
364
392
  return@asyncCall convertToRN(result)
365
393
  }
366
394
  }
@@ -588,8 +616,8 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
588
616
  @ReactMethod
589
617
  fun holderRegisterWalletUnit(request: ReadableMap, promise: Promise) {
590
618
  asyncCall(promise, scope) {
591
- getCore().holderRegisterWalletUnit(construct(request))
592
- return@asyncCall null
619
+ val result = getCore().holderRegisterWalletUnit(construct(request))
620
+ return@asyncCall convertToRN(result)
593
621
  }
594
622
  }
595
623
 
@@ -609,6 +637,21 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
609
637
  }
610
638
  }
611
639
 
640
+ @ReactMethod
641
+ fun nfcReadIsoMdlEngagement(request: ReadableMap, promise: Promise) {
642
+ asyncCall(promise, scope) {
643
+ return@asyncCall getCore().nfcReadIsoMdlEngagement(construct(request))
644
+ }
645
+ }
646
+
647
+ @ReactMethod
648
+ fun nfcStopIsoMdlEngagement(promise: Promise) {
649
+ asyncCall(promise, scope) {
650
+ getCore().nfcStopIsoMdlEngagement()
651
+ return@asyncCall null
652
+ }
653
+ }
654
+
612
655
  @ReactMethod
613
656
  fun uninitialize(deleteData: Boolean, promise: Promise) {
614
657
  asyncCall(promise, scope) {
@@ -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://onetfstatestorage.blob.core.windows.net/core-sdk/android/58802/onecore-debug.aar",
5
- "sha1": "42ea4049778b8b3b842e51682291e1ef445ce695"
4
+ "url": "https://onesdk.blob.core.windows.net/core-sdk/60807/android/onecore-debug.aar",
5
+ "sha1": "164dfcb986d8f86596e69ceed8a470562d3b0b6f"
6
6
  },
7
7
  "release": {
8
- "url": "https://onetfstatestorage.blob.core.windows.net/core-sdk/android/58802/onecore-release.aar",
9
- "sha1": "c7891e923cfe5501b278e80b3298ba901ae20825"
8
+ "url": "https://onesdk.blob.core.windows.net/core-sdk/60807/android/onecore-release.aar",
9
+ "sha1": "da72ce7724c932b14b19df2911ec7c2586c31130"
10
10
  }
11
11
  },
12
12
  "ios": {
13
- "url": "https://onetfstatestorage.blob.core.windows.net/core-sdk/ios/58802/deploy.zip",
14
- "sha1": "a2b9e352b1960121eacf6345326e4ad75734675b"
13
+ "url": "https://onesdk.blob.core.windows.net/core-sdk/60807/ios/deploy.zip",
14
+ "sha1": "7b5d19a6621d7e3eb0fcc492e70681001d5f3483"
15
15
  }
16
16
  }
@@ -12,7 +12,8 @@ import { CreateRemoteTrustEntityRequest, CreateTrustAnchorRequest, CreateTrustEn
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,6 +70,11 @@ 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
79
  holderAcceptCredential(interactionId: InvitationResultCredentialIssuance["interactionId"], didId: DidListItem["id"] | undefined, identifierId: IdentifierListItem["id"] | undefined, keyId: string | undefined, txCode: string | undefined): Promise<void>;
64
80
  holderRejectCredential(interactionId: InvitationResultCredentialIssuance["interactionId"]): Promise<void>;
@@ -67,10 +83,14 @@ export interface ONECore {
67
83
  /** For wallet-initiated flows, continues the OpenID4VCI issuance process
68
84
  * after completing authorization.
69
85
  */
70
- continueIssuance(url: string): Promise<ContinueIssuanceResponse>;
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>;
72
92
  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>;
93
+ holderSubmitProof(interactionId: InvitationResultProofRequest["interactionId"], credentials: Record<PresentationDefinitionRequestedCredential["id"], PresentationSubmitCredentialRequest | PresentationSubmitCredentialRequest[]>, didId: DidListItem["id"] | undefined, identifierId: IdentifierListItem["id"] | undefined, keyId: string | undefined): Promise<void>;
74
94
  getCredentials(query: CredentialListQuery): Promise<ItemList<CredentialListItem>>;
75
95
  runTask(task: string): Promise<string>;
76
96
  deleteProofClaims(proofId: ProofDetail["id"]): Promise<void>;
@@ -80,6 +100,7 @@ export interface ONECore {
80
100
  getCredentialSchema(credentialSchemaId: CredentialSchema["id"]): Promise<CredentialSchemaDetail>;
81
101
  getCredentialSchemas(query: CredentialSchemaListQuery): Promise<ItemList<CredentialSchema>>;
82
102
  deleteCredentialSchema(credentialSchemaId: CredentialSchema["id"]): Promise<void>;
103
+ /** For verifiers, creates a proof request. */
83
104
  createProof(request: CreateProofRequest): Promise<ProofDetail["id"]>;
84
105
  shareProof(proofId: ProofDetail["id"], request: ShareProofRequest): Promise<ShareProofResponse>;
85
106
  shareProofSchema(proofSchemaId: ProofSchema["id"]): Promise<ShareProofSchemaResponse>;
@@ -87,7 +108,11 @@ export interface ONECore {
87
108
  getProof(proofId: ProofDetail["id"]): Promise<ProofDetail>;
88
109
  getProofs(query: ProofListQuery): Promise<ItemList<ProofListItem>>;
89
110
  deleteProof(proofId: ProofDetail["id"]): Promise<void>;
90
- proposeProof(exchange: string, organisationId: string): Promise<ProposeProofResponse>;
111
+ /** For wallets, initiates device engagement for offline flows.
112
+ * Reference the `verificationEngagement` entry of your configuration
113
+ * for your options for `engagement`.
114
+ */
115
+ proposeProof(exchange: string, organisationId: string, engagement: string[]): Promise<ProposeProofResponse>;
91
116
  createProofSchema(request: CreateProofSchemaRequest): Promise<ProofSchema["id"]>;
92
117
  getProofSchemas(query: ProofSchemaListQuery): Promise<ItemList<ProofSchemaListItem>>;
93
118
  getProofSchema(proofSchemaId: ProofSchema["id"]): Promise<ProofSchema>;
@@ -133,9 +158,20 @@ export interface ONECore {
133
158
  */
134
159
  rollbackImport(): Promise<void>;
135
160
  resolveJsonldContext(url: string): Promise<ResolveJsonLdContextResponse>;
136
- holderRegisterWalletUnit(request: HolderRegisterWalletUnitRequest): Promise<void>;
161
+ holderRegisterWalletUnit(request: HolderRegisterWalletUnitRequest): Promise<HolderRegisterWalletUnitResponse>;
137
162
  holderRefreshWalletUnit(request: HolderRefreshWalletUnitRequest): Promise<void>;
138
163
  holderGetWalletUnitAttestation(organisationId: string): Promise<HolderAttestationWalletUnitResponse>;
164
+ /**
165
+ * Start scanning for ISO 18013-5 NFC engagement
166
+ *
167
+ * @param {NfcScanRequest} request system overlay messages to be displayed (iOS only)
168
+ * @returns {string} encoded NFC engagement to be used for {@link CreateProofRequest.isoMdlEngagement}
169
+ */
170
+ nfcReadIsoMdlEngagement(request: NfcScanRequest): Promise<string>;
171
+ /**
172
+ * Explicitly stop scan started via {@link nfcReadIsoMdlEngagement}
173
+ */
174
+ nfcStopIsoMdlEngagement(): Promise<void>;
139
175
  /**
140
176
  * Uninitialize the core instance
141
177
  *
@@ -145,4 +181,4 @@ export interface ONECore {
145
181
  */
146
182
  uninitialize(deleteData: boolean): Promise<void>;
147
183
  }
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"];
184
+ 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", "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";
@@ -81,6 +82,8 @@ export const interfaceMethodNames = [
81
82
  "holderRegisterWalletUnit",
82
83
  "holderRefreshWalletUnit",
83
84
  "holderGetWalletUnitAttestation",
85
+ "nfcReadIsoMdlEngagement",
86
+ "nfcStopIsoMdlEngagement",
84
87
  "uninitialize",
85
88
  ];
86
89
  // Typescript automatic assertions to keep ONECore and interfaceMethodNames in sync
@@ -99,6 +99,7 @@ export type CredentialListQuery = ListQuery & {
99
99
  ids?: Array<CredentialListItem["id"]>;
100
100
  status?: CredentialStateEnum[];
101
101
  profile?: string;
102
+ credentialSchemaIds?: Array<CredentialSchema["id"]>;
102
103
  include?: CredentialListIncludeEntityType[];
103
104
  /** accepts the RFC3339 format, e.g. use the {@link Date.toISOString} */
104
105
  createdDateAfter?: string;
@@ -132,9 +133,17 @@ export interface CredentialRevocationCheckResponse {
132
133
  reason?: string;
133
134
  }
134
135
  export interface InvitationResultCredentialIssuance {
136
+ /** For reference. */
135
137
  interactionId: string;
138
+ /** Offered credential. */
136
139
  credentialIds: Array<CredentialListItem["id"]>;
140
+ /** Metadata for entering a transaction code.
141
+ * If a pre-authorized code is issued with a transaction code object, the wallet
142
+ * user must input a transaction code to receive the offered credential. This code
143
+ * is typically sent through a separate channel such as SMS or email.
144
+ */
137
145
  txCode?: OpenID4VCITxCode;
146
+ /** Metadata for selecting an appropriate key. */
138
147
  credentialConfigurationsSupported: Record<CredentialListItem["id"], CredentialConfigurationSupported>;
139
148
  }
140
149
  export interface OpenID4VCITxCode {
@@ -165,9 +174,11 @@ export interface InitiateIssuanceResponse {
165
174
  url: string;
166
175
  }
167
176
  export interface ContinueIssuanceResponse {
177
+ /** For reference. */
168
178
  interactionId: string;
179
+ /** Offered credentials. */
169
180
  credentialIds: Array<CredentialListItem["id"]>;
170
- /** Informs client of API about valid options for issuance including applicable signing algorithms. */
181
+ /** Metadata for selecting an appropriate key. */
171
182
  credentialConfigurationsSupported: Record<CredentialListItem["id"], CredentialConfigurationSupported>;
172
183
  }
173
184
  export interface CredentialConfigurationSupported {
@@ -177,6 +188,9 @@ export interface OpenID4VCIProofTypeSupported {
177
188
  proofSigningAlgValuesSupported: string[];
178
189
  }
179
190
  export interface AuthorizationCodeFlow {
191
+ /** For reference. */
180
192
  interactionId: string;
193
+ /** For issuer-initiated Authorization Code Flows, use this URL to start
194
+ * the authorization process with the authorization server. */
181
195
  authorizationCodeFlowUrl: string;
182
196
  }
@@ -0,0 +1,5 @@
1
+ export interface NfcScanRequest {
2
+ inProgressMessage?: string;
3
+ failureMessage?: string;
4
+ successMessage?: string;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -45,6 +45,7 @@ export interface ProofDetail {
45
45
  completedDate?: string;
46
46
  claimsRemovedAt?: string;
47
47
  profile?: string;
48
+ engagement?: string;
48
49
  }
49
50
  export interface ProofListItem {
50
51
  id: string;
@@ -60,7 +61,14 @@ export interface ProofListItem {
60
61
  schema?: ProofSchemaListItem;
61
62
  retainUntilDate?: string;
62
63
  profile?: string;
63
- }
64
+ engagement?: string;
65
+ }
66
+ /** If protocol is `ISO_MDL`, specify the device engagement
67
+ * type by referencing an entry from `verificationEngagement`
68
+ * of your configurationi. `isoMdlEngagement` accepts either
69
+ * QR code content (for QR device engagement) or NFC engagement
70
+ * parameters from {@link nfcReadIsoMdlEngagement}.
71
+ */
64
72
  export interface CreateProofRequest {
65
73
  proofSchemaId: ProofSchemaListItem["id"];
66
74
  verifierDidId?: DidListItem["id"];
@@ -72,6 +80,7 @@ export interface CreateProofRequest {
72
80
  isoMdlEngagement?: string;
73
81
  transport?: string[];
74
82
  profile?: string;
83
+ engagement?: string;
75
84
  }
76
85
  export interface ScanToVerifyRequest {
77
86
  credential: string;
@@ -109,6 +118,7 @@ export declare enum PresentationDefinitionRuleTypeEnum {
109
118
  export interface PresentationDefinitionRequestedCredential {
110
119
  id: string;
111
120
  name?: string;
121
+ multiple?: boolean;
112
122
  purpose?: string;
113
123
  fields: PresentationDefinitionField[];
114
124
  applicableCredentials: Array<CredentialListItem["id"]>;
@@ -165,7 +175,7 @@ export interface ProofListQuery extends ListQuery {
165
175
  export interface ProposeProofResponse {
166
176
  proofId: string;
167
177
  interactionId: string;
168
- url: string;
178
+ url?: string;
169
179
  }
170
180
  export interface InvitationResultProofRequest {
171
181
  interactionId: string;
@@ -3,21 +3,29 @@ export declare enum WalletProviderTypeEnum {
3
3
  PROCIVIS_ONE = "PROCIVIS_ONE"
4
4
  }
5
5
  export declare enum WalletUnitStatusEnum {
6
+ PENDING = "PENDING",
6
7
  ACTIVE = "ACTIVE",
7
- REVOKED = "REVOKED"
8
+ REVOKED = "REVOKED",
9
+ ERROR = "ERROR"
8
10
  }
9
11
  export interface WalletProvider {
10
12
  url: string;
11
13
  type: WalletProviderTypeEnum;
12
14
  name: string;
15
+ appIntegrityCheckRequired: boolean;
13
16
  }
14
17
  export interface HolderRegisterWalletUnitRequest {
15
18
  organisationId: string;
16
19
  walletProvider: WalletProvider;
20
+ keyType: KeyListItem["keyType"];
21
+ }
22
+ export interface HolderRegisterWalletUnitResponse {
23
+ id: string;
17
24
  keyId: KeyListItem["id"];
18
25
  }
19
26
  export interface HolderRefreshWalletUnitRequest {
20
27
  organisationId: string;
28
+ appIntegrityCheckRequired: boolean;
21
29
  }
22
30
  export interface HolderAttestationWalletUnitResponse {
23
31
  id: string;
@@ -4,6 +4,8 @@ export var WalletProviderTypeEnum;
4
4
  })(WalletProviderTypeEnum || (WalletProviderTypeEnum = {}));
5
5
  export var WalletUnitStatusEnum;
6
6
  (function (WalletUnitStatusEnum) {
7
+ WalletUnitStatusEnum["PENDING"] = "PENDING";
7
8
  WalletUnitStatusEnum["ACTIVE"] = "ACTIVE";
8
9
  WalletUnitStatusEnum["REVOKED"] = "REVOKED";
10
+ WalletUnitStatusEnum["ERROR"] = "ERROR";
9
11
  })(WalletUnitStatusEnum || (WalletUnitStatusEnum = {}));
@@ -190,6 +190,7 @@ RCT_EXTERN_METHOD(deleteProof:(NSString *)proofId
190
190
 
191
191
  RCT_EXTERN_METHOD(proposeProof:(NSString *)exchange
192
192
  organisationId:(NSString *)organisationId
193
+ engagement:(NSArray *)engagement
193
194
  resolver:(RCTPromiseResolveBlock)resolve
194
195
  rejecter:(RCTPromiseRejectBlock)reject)
195
196
 
@@ -289,6 +290,13 @@ RCT_EXTERN_METHOD(holderGetWalletUnitAttestation:(NSString *)organisationId
289
290
  resolver:(RCTPromiseResolveBlock)resolve
290
291
  rejecter:(RCTPromiseRejectBlock)reject)
291
292
 
293
+ RCT_EXTERN_METHOD(nfcReadIsoMdlEngagement:(NSDictionary *)request
294
+ resolver:(RCTPromiseResolveBlock)resolve
295
+ rejecter:(RCTPromiseRejectBlock)reject)
296
+
297
+ RCT_EXTERN_METHOD(nfcStopIsoMdlEngagement:(RCTPromiseResolveBlock)resolve
298
+ rejecter:(RCTPromiseRejectBlock)reject)
299
+
292
300
  RCT_EXTERN_METHOD(uninitialize:(BOOL *)deleteData
293
301
  resolver:(RCTPromiseResolveBlock)resolve
294
302
  rejecter:(RCTPromiseRejectBlock)reject)
@@ -61,12 +61,16 @@ class ProcivisOneCoreModule: RCTEventEmitter {
61
61
  }
62
62
  }
63
63
  self.core = try initializeCore(
64
- configJson: configJson,
65
64
  dataDirPath: dataDirPath,
66
- nativeSecureElement: SecureEnclaveKeyStorage(),
67
- remoteSecureElement: rseKeyStorage,
68
- bleCentral: IOSBLECentral(),
69
- blePeripheral: IOSBLEPeripheral()
65
+ params: InitParamsDto(
66
+ configJson: configJson,
67
+ nativeSecureElement: SecureEnclaveKeyStorage(),
68
+ remoteSecureElement: rseKeyStorage,
69
+ bleCentral: IOSBLECentral(),
70
+ blePeripheral: IOSBLEPeripheral(),
71
+ nfcHce: nil,
72
+ nfcScanner: NFCScanner()
73
+ )
70
74
  )
71
75
 
72
76
  return nil as NSDictionary?
@@ -579,17 +583,19 @@ class ProcivisOneCoreModule: RCTEventEmitter {
579
583
  }
580
584
  }
581
585
 
582
- @objc(proposeProof:organisationId:resolver:rejecter:)
586
+ @objc(proposeProof:organisationId:engagement:resolver:rejecter:)
583
587
  func proposeProof(
584
588
  exchange: String,
585
589
  organisationId: String,
590
+ engagement: NSArray,
586
591
  resolve: @escaping RCTPromiseResolveBlock,
587
592
  reject: @escaping RCTPromiseRejectBlock
588
593
  ) {
589
594
  asyncCall(resolve, reject) {
590
595
  let result = try await self.getCore().proposeProof(
591
596
  exchange: exchange,
592
- organisationId: organisationId
597
+ organisationId: organisationId,
598
+ engagement: try deserialize(engagement)
593
599
  )
594
600
  return try serializeAny(result)
595
601
  }
@@ -865,8 +871,8 @@ class ProcivisOneCoreModule: RCTEventEmitter {
865
871
  reject: @escaping RCTPromiseRejectBlock
866
872
  ) {
867
873
  asyncCall(resolve, reject) {
868
- try await self.getCore().holderRegisterWalletUnit(request: try deserialize(request))
869
- return nil as NSDictionary?
874
+ let result = try await self.getCore().holderRegisterWalletUnit(request: try deserialize(request))
875
+ return try serializeAny(result)
870
876
  }
871
877
  }
872
878
 
@@ -894,6 +900,28 @@ class ProcivisOneCoreModule: RCTEventEmitter {
894
900
  }
895
901
  }
896
902
 
903
+ @objc(nfcReadIsoMdlEngagement:resolver:rejecter:)
904
+ func nfcReadIsoMdlEngagement(
905
+ request: NSDictionary,
906
+ resolve: @escaping RCTPromiseResolveBlock,
907
+ reject: @escaping RCTPromiseRejectBlock
908
+ ) {
909
+ asyncCall(resolve, reject) {
910
+ return try await self.getCore().nfcReadIsoMdlEngagement(request: try deserialize(request))
911
+ }
912
+ }
913
+
914
+ @objc(nfcStopIsoMdlEngagement:rejecter:)
915
+ func nfcStopIsoMdlEngagement(
916
+ resolve: @escaping RCTPromiseResolveBlock,
917
+ reject: @escaping RCTPromiseRejectBlock
918
+ ) {
919
+ asyncCall(resolve, reject) {
920
+ try await self.getCore().nfcStopIsoMdlEngagement()
921
+ return nil as NSDictionary?
922
+ }
923
+ }
924
+
897
925
  @objc(uninitialize:resolver:rejecter:)
898
926
  func uninitialize(
899
927
  deleteData: Bool,
@@ -178,7 +178,19 @@ class RSEKeyStorage: NativeKeyStorage {
178
178
 
179
179
  return signatureData
180
180
  }
181
-
181
+
182
+ func generateAttestation(keyReference: Data, nonce: String?) async throws -> [String] {
183
+ throw NativeKeyStorageError.Unsupported
184
+ }
185
+
186
+ func generateAttestationKey(keyAlias: String, nonce: String?) async throws -> ProcivisOneCore.GeneratedKeyBindingDto {
187
+ throw NativeKeyStorageError.Unsupported
188
+ }
189
+
190
+ func signWithAttestationKey(keyReference: Data, message: Data) async throws -> Data {
191
+ throw NativeKeyStorageError.Unsupported
192
+ }
193
+
182
194
  func changePin() async throws {
183
195
  guard let asset = UbqSdk.assets.first else {
184
196
  throw NativeKeyStorageError.SignatureFailure(reason: "Key does not exist")
@@ -18,6 +18,18 @@ class RSEKeyStorage: NativeKeyStorage {
18
18
  func sign(keyReference: Data, message: Data) async throws -> Data {
19
19
  fatalError("sign(keyReference:,message:) has not been implemented")
20
20
  }
21
+
22
+ func generateAttestation(keyReference: Data, nonce: String?) async throws -> [String] {
23
+ fatalError("generateAttestation(keyReference:,nonce:) has not been implemented")
24
+ }
25
+
26
+ func generateAttestationKey(keyAlias: String, nonce: String?) async throws -> ProcivisOneCore.GeneratedKeyBindingDto {
27
+ fatalError("generateAttestationKey(keyAlias:,nonce:) has not been implemented")
28
+ }
29
+
30
+ func signWithAttestationKey(keyReference: Data, message: Data) async throws -> Data {
31
+ fatalError("signWithAttestationKey(keyReference:,message:) has not been implemented")
32
+ }
21
33
 
22
34
  func changePin() async throws {
23
35
  fatalError("changePin() has not been implemented")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procivis/react-native-one-core",
3
- "version": "1.58802.0",
3
+ "version": "1.60807.0",
4
4
  "author": "Procivis AG (https://procivis.ch)",
5
5
  "license": "Apache-2.0",
6
6
  "description": "ONE core bindings for React Native",