@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/dist/src/credential.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataTypeEnum } from "./config";
|
|
2
|
-
import { CredentialSchema } from "./credentialSchema";
|
|
2
|
+
import { CredentialSchema, WalletStorageType } from "./credentialSchema";
|
|
3
3
|
import { ListQuery, SortDirection } from "./list";
|
|
4
4
|
import { IdentifierListItem } from "./identifier";
|
|
5
5
|
export declare enum CredentialStateEnum {
|
|
@@ -13,7 +13,7 @@ export declare enum CredentialStateEnum {
|
|
|
13
13
|
ERROR = "ERROR"
|
|
14
14
|
}
|
|
15
15
|
export type ClaimValue = {
|
|
16
|
-
dataType: DataTypeEnum.String | DataTypeEnum.Date | DataTypeEnum.
|
|
16
|
+
dataType: DataTypeEnum.String | DataTypeEnum.Date | DataTypeEnum.Picture | DataTypeEnum.SwiyuPicture;
|
|
17
17
|
value: string;
|
|
18
18
|
array: false;
|
|
19
19
|
} | {
|
|
@@ -95,10 +95,11 @@ export type CredentialListQuery = ListQuery & {
|
|
|
95
95
|
sort?: SortableCredentialColumnEnum;
|
|
96
96
|
sortDirection?: SortDirection;
|
|
97
97
|
exact?: CredentialListQueryExactColumnEnum[];
|
|
98
|
-
|
|
98
|
+
roles?: CredentialRoleEnum[];
|
|
99
99
|
ids?: Array<CredentialListItem["id"]>;
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
states?: CredentialStateEnum[];
|
|
101
|
+
profiles?: 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,10 +133,16 @@ export interface CredentialRevocationCheckResponse {
|
|
|
132
133
|
reason?: string;
|
|
133
134
|
}
|
|
134
135
|
export interface InvitationResultCredentialIssuance {
|
|
136
|
+
/** For reference. */
|
|
135
137
|
interactionId: string;
|
|
136
|
-
|
|
138
|
+
/** Metadata for entering a transaction code.
|
|
139
|
+
* If a pre-authorized code is issued with a transaction code object, the wallet
|
|
140
|
+
* user must input a transaction code to receive the offered credential. This code
|
|
141
|
+
* is typically sent through a separate channel such as SMS or email.
|
|
142
|
+
*/
|
|
137
143
|
txCode?: OpenID4VCITxCode;
|
|
138
|
-
|
|
144
|
+
/** Required storage type for holder binding key */
|
|
145
|
+
walletStorageType?: WalletStorageType;
|
|
139
146
|
}
|
|
140
147
|
export interface OpenID4VCITxCode {
|
|
141
148
|
inputMode?: OpenID4VCITxCodeInputMode;
|
|
@@ -165,18 +172,18 @@ export interface InitiateIssuanceResponse {
|
|
|
165
172
|
url: string;
|
|
166
173
|
}
|
|
167
174
|
export interface ContinueIssuanceResponse {
|
|
175
|
+
/** For reference. */
|
|
168
176
|
interactionId: string;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
credentialConfigurationsSupported: Record<CredentialListItem["id"], CredentialConfigurationSupported>;
|
|
172
|
-
}
|
|
173
|
-
export interface CredentialConfigurationSupported {
|
|
174
|
-
proofTypesSupported: Record<string, OpenID4VCIProofTypeSupported>;
|
|
177
|
+
/** Required storage type for holder binding key */
|
|
178
|
+
walletStorageType?: WalletStorageType;
|
|
175
179
|
}
|
|
176
180
|
export interface OpenID4VCIProofTypeSupported {
|
|
177
181
|
proofSigningAlgValuesSupported: string[];
|
|
178
182
|
}
|
|
179
183
|
export interface AuthorizationCodeFlow {
|
|
184
|
+
/** For reference. */
|
|
180
185
|
interactionId: string;
|
|
186
|
+
/** For issuer-initiated Authorization Code Flows, use this URL to start
|
|
187
|
+
* the authorization process with the authorization server. */
|
|
181
188
|
authorizationCodeFlowUrl: string;
|
|
182
189
|
}
|
|
@@ -75,7 +75,8 @@ export interface CredentialSchemaListQuery extends ListQuery {
|
|
|
75
75
|
export declare enum WalletStorageType {
|
|
76
76
|
HARDWARE = "HARDWARE",
|
|
77
77
|
SOFTWARE = "SOFTWARE",
|
|
78
|
-
REMOTE_SECURE_ELEMENT = "REMOTE_SECURE_ELEMENT"
|
|
78
|
+
REMOTE_SECURE_ELEMENT = "REMOTE_SECURE_ELEMENT",
|
|
79
|
+
EUDI_COMPLIANT = "EUDI_COMPLIANT"
|
|
79
80
|
}
|
|
80
81
|
export declare enum KnownCredentialSchemaType {
|
|
81
82
|
PROCIVIS_ONE_SCHEMA2024 = "PROCIVIS_ONE_SCHEMA2024",
|
|
@@ -18,6 +18,7 @@ export var WalletStorageType;
|
|
|
18
18
|
WalletStorageType["HARDWARE"] = "HARDWARE";
|
|
19
19
|
WalletStorageType["SOFTWARE"] = "SOFTWARE";
|
|
20
20
|
WalletStorageType["REMOTE_SECURE_ELEMENT"] = "REMOTE_SECURE_ELEMENT";
|
|
21
|
+
WalletStorageType["EUDI_COMPLIANT"] = "EUDI_COMPLIANT";
|
|
21
22
|
})(WalletStorageType || (WalletStorageType = {}));
|
|
22
23
|
export var KnownCredentialSchemaType;
|
|
23
24
|
(function (KnownCredentialSchemaType) {
|
package/dist/src/history.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ export interface HistoryListQuery extends ListQuery {
|
|
|
65
65
|
credentialSchemaId?: string;
|
|
66
66
|
proofSchemaId?: string;
|
|
67
67
|
search?: HistoryListSearch;
|
|
68
|
+
user?: string;
|
|
68
69
|
}
|
|
69
70
|
export interface HistoryListSearch {
|
|
70
71
|
text: string;
|
|
@@ -88,4 +89,5 @@ export interface HistoryListItem {
|
|
|
88
89
|
entityType: HistoryEntityTypeEnum;
|
|
89
90
|
organisationId: string;
|
|
90
91
|
metadata?: HistoryMetadata;
|
|
92
|
+
user?: string;
|
|
91
93
|
}
|
package/dist/src/identifier.d.ts
CHANGED
|
@@ -115,7 +115,7 @@ export interface IdentifierListQuery extends ListQuery {
|
|
|
115
115
|
sortDirection?: SortDirection;
|
|
116
116
|
name?: string;
|
|
117
117
|
types?: IdentifierTypeEnum[];
|
|
118
|
-
|
|
118
|
+
states?: IdentifierStateEnum[];
|
|
119
119
|
exact?: ExactIdentifierFilterColumnEnum[];
|
|
120
120
|
didMethods?: string[];
|
|
121
121
|
isRemote?: boolean;
|
package/dist/src/nfc.js
ADDED
package/dist/src/proof.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Claim, CredentialDetail, CredentialListItem } from "./credential";
|
|
2
|
-
import { CredentialSchema } from "./credentialSchema";
|
|
2
|
+
import { ClaimSchema, CredentialSchema } from "./credentialSchema";
|
|
3
3
|
import { ListQuery, SortDirection } from "./list";
|
|
4
4
|
import { ProofInputClaimSchema, ProofSchemaListItem } from "./proofSchema";
|
|
5
5
|
import { DidListItem } from "./did";
|
|
@@ -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"]>;
|
|
@@ -126,6 +136,40 @@ export interface PresentationSubmitCredentialRequest {
|
|
|
126
136
|
credentialId: CredentialListItem["id"];
|
|
127
137
|
submitClaims: Array<PresentationDefinitionField["id"]>;
|
|
128
138
|
}
|
|
139
|
+
export interface PresentationDefinitionV2 {
|
|
140
|
+
credentialQueries: Record<string, PresentationDefinitionV2CredentialQuery>;
|
|
141
|
+
credentialSets: Array<{
|
|
142
|
+
required: boolean;
|
|
143
|
+
options: Array<Array<string>>;
|
|
144
|
+
}>;
|
|
145
|
+
}
|
|
146
|
+
export type PresentationDefinitionV2CredentialQuery = {
|
|
147
|
+
multiple: boolean;
|
|
148
|
+
} & (ApplicableCredentials | FailureHint);
|
|
149
|
+
export interface ApplicableCredentials {
|
|
150
|
+
applicableCredentials: Array<PresentationDefinitionV2CredentialDetail>;
|
|
151
|
+
}
|
|
152
|
+
export interface FailureHint {
|
|
153
|
+
failureHint: {
|
|
154
|
+
credentialSchema?: CredentialSchema;
|
|
155
|
+
reason: "NO_CREDENTIAL" | "VALIDITY" | "CONSTRAINT";
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
export interface PresentationDefinitionV2CredentialDetail extends Omit<CredentialDetail, "claims"> {
|
|
159
|
+
claims: Array<PresentationDefinitionV2CredentialClaim>;
|
|
160
|
+
}
|
|
161
|
+
export interface PresentationDefinitionV2CredentialClaim {
|
|
162
|
+
path: string;
|
|
163
|
+
schema: ClaimSchema;
|
|
164
|
+
value: PresentationDefinitionV2ClaimValue;
|
|
165
|
+
userSelection: boolean;
|
|
166
|
+
required: boolean;
|
|
167
|
+
}
|
|
168
|
+
export type PresentationDefinitionV2ClaimValue = string | number | boolean | PresentationDefinitionV2CredentialClaim[];
|
|
169
|
+
export interface PresentationSubmitV2CredentialRequest {
|
|
170
|
+
credentialId: CredentialListItem["id"];
|
|
171
|
+
userSelections: Array<string>;
|
|
172
|
+
}
|
|
129
173
|
export declare enum SortableProofColumnEnum {
|
|
130
174
|
SCHEMA_NAME = "SCHEMA_NAME",
|
|
131
175
|
VERIFIER = "VERIFIER",
|
|
@@ -144,7 +188,7 @@ export interface ProofListQuery extends ListQuery {
|
|
|
144
188
|
proofRoles?: ProofRoleEnum[];
|
|
145
189
|
proofSchemaIds?: string[];
|
|
146
190
|
exact?: ExactProofFilterColumnEnum[];
|
|
147
|
-
|
|
191
|
+
profiles?: string[];
|
|
148
192
|
/** accepts the RFC3339 format, e.g. use the {@link Date.toISOString} */
|
|
149
193
|
createdDateAfter?: string;
|
|
150
194
|
/** accepts the RFC3339 format, e.g. use the {@link Date.toISOString} */
|
|
@@ -162,10 +206,16 @@ export interface ProofListQuery extends ListQuery {
|
|
|
162
206
|
/** accepts the RFC3339 format, e.g. use the {@link Date.toISOString} */
|
|
163
207
|
completedDateBefore?: string;
|
|
164
208
|
}
|
|
209
|
+
export interface ProposeProofRequest {
|
|
210
|
+
protocol: string;
|
|
211
|
+
organisationId: string;
|
|
212
|
+
engagement: string[];
|
|
213
|
+
uiMessage?: string;
|
|
214
|
+
}
|
|
165
215
|
export interface ProposeProofResponse {
|
|
166
216
|
proofId: string;
|
|
167
217
|
interactionId: string;
|
|
168
|
-
url
|
|
218
|
+
url?: string;
|
|
169
219
|
}
|
|
170
220
|
export interface InvitationResultProofRequest {
|
|
171
221
|
interactionId: string;
|
package/dist/src/trust.d.ts
CHANGED
|
@@ -107,13 +107,18 @@ export interface CreateTrustEntityRequest {
|
|
|
107
107
|
content?: string;
|
|
108
108
|
organisationId: UpsertOrganisationRequest["id"];
|
|
109
109
|
}
|
|
110
|
-
export interface TrustEntityListQuery {
|
|
110
|
+
export interface TrustEntityListQuery extends Omit<ListQuery, "organisationId"> {
|
|
111
111
|
sort?: SortableTrustEntityColumnEnum;
|
|
112
112
|
sortDirection?: SortDirection;
|
|
113
|
+
organisationId?: string;
|
|
113
114
|
name?: string;
|
|
114
115
|
exact?: ExactTrustEntityFilterColumnEnum[];
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
role?: TrustEntityRoleEnum;
|
|
117
|
+
trustAnchor?: TrustAnchor["id"];
|
|
118
|
+
didId?: DidListItem["id"];
|
|
119
|
+
types?: TrustEntityTypeEnum[];
|
|
120
|
+
entityKey?: string;
|
|
121
|
+
states?: TrustEntityStateEnum[];
|
|
117
122
|
/** accepts the RFC3339 format, e.g. use the {@link Date.toISOString} */
|
|
118
123
|
createdDateAfter?: string;
|
|
119
124
|
/** accepts the RFC3339 format, e.g. use the {@link Date.toISOString} */
|
package/dist/src/walletUnit.d.ts
CHANGED
|
@@ -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;
|
package/dist/src/walletUnit.js
CHANGED
|
@@ -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 = {}));
|
|
@@ -91,6 +91,10 @@ RCT_EXTERN_METHOD(getPresentationDefinition:(NSString *)proofId
|
|
|
91
91
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
92
92
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
93
93
|
|
|
94
|
+
RCT_EXTERN_METHOD(getPresentationDefinitionV2:(NSString *)proofId
|
|
95
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
96
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
97
|
+
|
|
94
98
|
RCT_EXTERN_METHOD(holderRejectProof:(NSString *)interactionId
|
|
95
99
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
96
100
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
@@ -103,6 +107,11 @@ RCT_EXTERN_METHOD(holderSubmitProof:(NSString *)interactionId
|
|
|
103
107
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
104
108
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
105
109
|
|
|
110
|
+
RCT_EXTERN_METHOD(holderSubmitProofV2:(NSString *)interactionId
|
|
111
|
+
submission:(NSDictionary *)submission
|
|
112
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
113
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
114
|
+
|
|
106
115
|
RCT_EXTERN_METHOD(getCredentials:(NSDictionary *)query
|
|
107
116
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
108
117
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
@@ -188,8 +197,7 @@ RCT_EXTERN_METHOD(deleteProof:(NSString *)proofId
|
|
|
188
197
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
189
198
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
190
199
|
|
|
191
|
-
RCT_EXTERN_METHOD(proposeProof:(
|
|
192
|
-
organisationId:(NSString *)organisationId
|
|
200
|
+
RCT_EXTERN_METHOD(proposeProof:(NSDictionary *)request
|
|
193
201
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
194
202
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
195
203
|
|
|
@@ -289,14 +297,24 @@ RCT_EXTERN_METHOD(holderGetWalletUnitAttestation:(NSString *)organisationId
|
|
|
289
297
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
290
298
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
291
299
|
|
|
292
|
-
RCT_EXTERN_METHOD(
|
|
300
|
+
RCT_EXTERN_METHOD(nfcReadIsoMdlEngagement:(NSDictionary *)request
|
|
293
301
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
294
302
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
295
303
|
|
|
304
|
+
RCT_EXTERN_METHOD(nfcStopIsoMdlEngagement:(RCTPromiseResolveBlock)resolve
|
|
305
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
306
|
+
|
|
296
307
|
RCT_EXTERN_METHOD(deleteCache:(NSArray *)types
|
|
297
308
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
298
309
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
299
310
|
|
|
311
|
+
RCT_EXTERN_METHOD(uninitialize:(BOOL *)deleteData
|
|
312
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
313
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
314
|
+
|
|
315
|
+
RCT_EXTERN_METHOD(isNfcHceSupported:(RCTPromiseResolveBlock)resolve
|
|
316
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
317
|
+
|
|
300
318
|
RCT_EXTERN_METHOD(changeRSEPin:(RCTPromiseResolveBlock)resolve
|
|
301
319
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
302
320
|
|
|
@@ -13,6 +13,14 @@ class ProcivisOneCoreModule: RCTEventEmitter {
|
|
|
13
13
|
private static let TAG = "ProcivisOneCoreModule"
|
|
14
14
|
private var core: OneCoreBindingProtocol? = nil
|
|
15
15
|
private var rseKeyStorage: NativeKeyStorage? = nil
|
|
16
|
+
private var nfcHce: NfcHce? = nil
|
|
17
|
+
|
|
18
|
+
public override init() {
|
|
19
|
+
super.init()
|
|
20
|
+
if #available(iOS 17.4, *) {
|
|
21
|
+
nfcHce = NFCHCE()
|
|
22
|
+
}
|
|
23
|
+
}
|
|
16
24
|
|
|
17
25
|
@objc(initialize:resolver:rejecter:)
|
|
18
26
|
func initialize(
|
|
@@ -60,13 +68,18 @@ class ProcivisOneCoreModule: RCTEventEmitter {
|
|
|
60
68
|
rseKeyStorage = RSEKeyStorage()
|
|
61
69
|
}
|
|
62
70
|
}
|
|
71
|
+
|
|
63
72
|
self.core = try initializeCore(
|
|
64
|
-
configJson: configJson,
|
|
65
73
|
dataDirPath: dataDirPath,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
params: InitParamsDto(
|
|
75
|
+
configJson: configJson,
|
|
76
|
+
nativeSecureElement: SecureEnclaveKeyStorage(),
|
|
77
|
+
remoteSecureElement: rseKeyStorage,
|
|
78
|
+
bleCentral: IOSBLECentral(),
|
|
79
|
+
blePeripheral: IOSBLEPeripheral(),
|
|
80
|
+
nfcHce: nfcHce,
|
|
81
|
+
nfcScanner: NFCScanner()
|
|
82
|
+
)
|
|
70
83
|
)
|
|
71
84
|
|
|
72
85
|
return nil as NSDictionary?
|
|
@@ -231,14 +244,13 @@ class ProcivisOneCoreModule: RCTEventEmitter {
|
|
|
231
244
|
reject: @escaping RCTPromiseRejectBlock
|
|
232
245
|
) {
|
|
233
246
|
asyncCall(resolve, reject) {
|
|
234
|
-
try await self.getCore().holderAcceptCredential(
|
|
247
|
+
return try await self.getCore().holderAcceptCredential(
|
|
235
248
|
interactionId: interactionId,
|
|
236
249
|
didId: didId,
|
|
237
250
|
identifierId: identifierId,
|
|
238
251
|
keyId: keyId,
|
|
239
252
|
txCode: txCode
|
|
240
253
|
)
|
|
241
|
-
return nil as NSDictionary?
|
|
242
254
|
}
|
|
243
255
|
}
|
|
244
256
|
|
|
@@ -290,6 +302,18 @@ class ProcivisOneCoreModule: RCTEventEmitter {
|
|
|
290
302
|
}
|
|
291
303
|
}
|
|
292
304
|
|
|
305
|
+
@objc(getPresentationDefinitionV2:resolver:rejecter:)
|
|
306
|
+
func getPresentationDefinitionV2(
|
|
307
|
+
proofId: String,
|
|
308
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
309
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
310
|
+
) {
|
|
311
|
+
asyncCall(resolve, reject) {
|
|
312
|
+
let result = try await self.getCore().getPresentationDefinitionV2(proofId: proofId)
|
|
313
|
+
return try serializeAny(result)
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
293
317
|
@objc(holderRejectProof:resolver:rejecter:)
|
|
294
318
|
func rejectProof(
|
|
295
319
|
interactionId: String,
|
|
@@ -324,6 +348,22 @@ class ProcivisOneCoreModule: RCTEventEmitter {
|
|
|
324
348
|
}
|
|
325
349
|
}
|
|
326
350
|
|
|
351
|
+
@objc(holderSubmitProofV2:submission:resolver:rejecter:)
|
|
352
|
+
func holderSubmitProofV2(
|
|
353
|
+
interactionId: String,
|
|
354
|
+
submission: NSDictionary,
|
|
355
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
356
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
357
|
+
) {
|
|
358
|
+
asyncCall(resolve, reject) {
|
|
359
|
+
try await self.getCore().holderSubmitProofV2(
|
|
360
|
+
interactionId: interactionId,
|
|
361
|
+
submission: try deserialize(submission),
|
|
362
|
+
)
|
|
363
|
+
return nil as NSDictionary?
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
327
367
|
@objc(getCredentials:resolver:rejecter:)
|
|
328
368
|
func getCredentials(
|
|
329
369
|
query: NSDictionary,
|
|
@@ -579,18 +619,14 @@ class ProcivisOneCoreModule: RCTEventEmitter {
|
|
|
579
619
|
}
|
|
580
620
|
}
|
|
581
621
|
|
|
582
|
-
@objc(proposeProof:
|
|
622
|
+
@objc(proposeProof:resolver:rejecter:)
|
|
583
623
|
func proposeProof(
|
|
584
|
-
|
|
585
|
-
organisationId: String,
|
|
624
|
+
request: NSDictionary,
|
|
586
625
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
587
626
|
reject: @escaping RCTPromiseRejectBlock
|
|
588
627
|
) {
|
|
589
628
|
asyncCall(resolve, reject) {
|
|
590
|
-
let result = try await self.getCore().proposeProof(
|
|
591
|
-
exchange: exchange,
|
|
592
|
-
organisationId: organisationId
|
|
593
|
-
)
|
|
629
|
+
let result = try await self.getCore().proposeProof(request: try deserialize(request))
|
|
594
630
|
return try serializeAny(result)
|
|
595
631
|
}
|
|
596
632
|
}
|
|
@@ -865,8 +901,8 @@ class ProcivisOneCoreModule: RCTEventEmitter {
|
|
|
865
901
|
reject: @escaping RCTPromiseRejectBlock
|
|
866
902
|
) {
|
|
867
903
|
asyncCall(resolve, reject) {
|
|
868
|
-
try await self.getCore().holderRegisterWalletUnit(request: try deserialize(request))
|
|
869
|
-
return
|
|
904
|
+
let result = try await self.getCore().holderRegisterWalletUnit(request: try deserialize(request))
|
|
905
|
+
return try serializeAny(result)
|
|
870
906
|
}
|
|
871
907
|
}
|
|
872
908
|
|
|
@@ -894,6 +930,28 @@ class ProcivisOneCoreModule: RCTEventEmitter {
|
|
|
894
930
|
}
|
|
895
931
|
}
|
|
896
932
|
|
|
933
|
+
@objc(nfcReadIsoMdlEngagement:resolver:rejecter:)
|
|
934
|
+
func nfcReadIsoMdlEngagement(
|
|
935
|
+
request: NSDictionary,
|
|
936
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
937
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
938
|
+
) {
|
|
939
|
+
asyncCall(resolve, reject) {
|
|
940
|
+
return try await self.getCore().nfcReadIsoMdlEngagement(request: try deserialize(request))
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
@objc(nfcStopIsoMdlEngagement:rejecter:)
|
|
945
|
+
func nfcStopIsoMdlEngagement(
|
|
946
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
947
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
948
|
+
) {
|
|
949
|
+
asyncCall(resolve, reject) {
|
|
950
|
+
try await self.getCore().nfcStopIsoMdlEngagement()
|
|
951
|
+
return nil as NSDictionary?
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
|
|
897
955
|
@objc(uninitialize:resolver:rejecter:)
|
|
898
956
|
func uninitialize(
|
|
899
957
|
deleteData: Bool,
|
|
@@ -910,6 +968,19 @@ class ProcivisOneCoreModule: RCTEventEmitter {
|
|
|
910
968
|
}
|
|
911
969
|
}
|
|
912
970
|
|
|
971
|
+
@objc(isNfcHceSupported:rejecter:)
|
|
972
|
+
func isNfcHceSupported(
|
|
973
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
974
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
975
|
+
) {
|
|
976
|
+
asyncCall(resolve, reject) {
|
|
977
|
+
if let nfcHce = self.nfcHce {
|
|
978
|
+
return try await nfcHce.isSupported()
|
|
979
|
+
}
|
|
980
|
+
return false
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
|
|
913
984
|
// MARK: Ubiqu specific methods
|
|
914
985
|
|
|
915
986
|
@objc(changeRSEPin:rejecter:)
|
package/ios/RSEKeyStorage.swift
CHANGED
|
@@ -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/ios/Serialize.swift
CHANGED
|
@@ -16,15 +16,15 @@ func serializeAny<T: Encodable>(_ value: T) throws -> Any {
|
|
|
16
16
|
|
|
17
17
|
// Enum values serialization
|
|
18
18
|
func serializeEnumValue<T>(value: T) -> String {
|
|
19
|
-
|
|
19
|
+
return String(describing: value).snakeCased()
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
private let snakeCaseRegex = try! NSRegularExpression(pattern: "([a-z0-9])([A-Z])", options: [])
|
|
23
23
|
extension String {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
func snakeCased() -> String {
|
|
25
|
+
let range = NSRange(location: 0, length: count)
|
|
26
|
+
return snakeCaseRegex.stringByReplacingMatches(in: self, options: [], range: range, withTemplate: "$1_$2").uppercased()
|
|
27
|
+
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
private func serializeSpecific(_ value: Encodable) throws -> Any? {
|
|
@@ -39,7 +39,11 @@ private func serializeSpecific(_ value: Encodable) throws -> Any? {
|
|
|
39
39
|
return try serialize(proofRequestClaimValue: data)
|
|
40
40
|
case let data as HandleInvitationResponseBindingEnum:
|
|
41
41
|
return try serialize(invitationResponse: data)
|
|
42
|
-
|
|
42
|
+
case let data as CredentialQueryResponseBindingDto:
|
|
43
|
+
return try serialize(credentialQuery: data)
|
|
44
|
+
case let data as PresentationDefinitionV2ClaimValueBindingDto:
|
|
45
|
+
return try serialize(presentationDefinitionV2ClaimValue: data)
|
|
46
|
+
|
|
43
47
|
default:
|
|
44
48
|
return nil
|
|
45
49
|
}
|
|
@@ -97,17 +101,18 @@ private func serialize(proofRequestClaimValue: ProofRequestClaimValueBindingDto)
|
|
|
97
101
|
|
|
98
102
|
private func serialize(invitationResponse: HandleInvitationResponseBindingEnum) throws -> NSDictionary {
|
|
99
103
|
switch (invitationResponse) {
|
|
100
|
-
case let .credentialIssuance(interactionId,
|
|
104
|
+
case let .credentialIssuance(interactionId, walletStorageType, txCode):
|
|
101
105
|
var result: [String: Any] = [
|
|
102
|
-
"interactionId": interactionId
|
|
103
|
-
"credentialIds": credentialIds,
|
|
104
|
-
"credentialConfigurationsSupported": try serializeAny(credentialConfigurationsSupported)
|
|
106
|
+
"interactionId": interactionId
|
|
105
107
|
];
|
|
108
|
+
if let walletStorageType = walletStorageType {
|
|
109
|
+
result["walletStorageType"] = serializeEnumValue(value: walletStorageType)
|
|
110
|
+
}
|
|
106
111
|
if let txCode = txCode {
|
|
107
112
|
result["txCode"] = try serializeAny(txCode)
|
|
108
113
|
}
|
|
109
114
|
return result as NSDictionary;
|
|
110
|
-
|
|
115
|
+
|
|
111
116
|
case let .proofRequest(interactionId, proofId):
|
|
112
117
|
return [
|
|
113
118
|
"interactionId": interactionId,
|
|
@@ -121,3 +126,29 @@ private func serialize(invitationResponse: HandleInvitationResponseBindingEnum)
|
|
|
121
126
|
];
|
|
122
127
|
}
|
|
123
128
|
}
|
|
129
|
+
|
|
130
|
+
private func serialize(credentialQuery: CredentialQueryResponseBindingDto) throws -> Any {
|
|
131
|
+
var result: [String: Any] = ["multiple": credentialQuery.multiple]
|
|
132
|
+
switch (credentialQuery.credentialOrFailureHint) {
|
|
133
|
+
case let .applicableCredentials(applicableCredentials: value):
|
|
134
|
+
result["applicableCredentials"] = try serializeAny(value);
|
|
135
|
+
case let .failureHint(failureHint: value):
|
|
136
|
+
result["failureHint"] = try serializeAny(value);
|
|
137
|
+
}
|
|
138
|
+
return result as NSDictionary;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
private func serialize(presentationDefinitionV2ClaimValue: PresentationDefinitionV2ClaimValueBindingDto) throws -> Any {
|
|
142
|
+
switch (presentationDefinitionV2ClaimValue) {
|
|
143
|
+
case let .boolean(value):
|
|
144
|
+
return value;
|
|
145
|
+
case let .float(value):
|
|
146
|
+
return value;
|
|
147
|
+
case let .integer(value):
|
|
148
|
+
return NSNumber(value: value);
|
|
149
|
+
case let .string(value):
|
|
150
|
+
return value;
|
|
151
|
+
case .nested(value: let values):
|
|
152
|
+
return try values.map { try serializeAny($0) }
|
|
153
|
+
}
|
|
154
|
+
}
|