@regulaforensics/document-reader 9.4.713-rc → 9.4.715-nightly

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.
Files changed (36) hide show
  1. package/RNDocumentReader.podspec +2 -2
  2. package/android/build.gradle +2 -2
  3. package/android/cordova.gradle +2 -2
  4. package/android/src/main/java/com/regula/plugin/documentreader/JSONConstructor.kt +36 -0
  5. package/android/src/main/java/com/regula/plugin/documentreader/Main.kt +46 -43
  6. package/examples/capacitor/package-lock.json +15 -15
  7. package/examples/capacitor/package.json +1 -1
  8. package/examples/ionic/package-lock.json +208 -235
  9. package/examples/ionic/package.json +3 -2
  10. package/examples/react_native/package-lock.json +33 -30
  11. package/examples/react_native/package.json +1 -1
  12. package/ios/RGLWJSONConstructor.h +4 -0
  13. package/ios/RGLWJSONConstructor.m +93 -47
  14. package/ios/RGLWMain.h +2 -4
  15. package/ios/RGLWMain.m +49 -13
  16. package/ios/RNDocumentReader.m +2 -0
  17. package/package.json +1 -1
  18. package/plugin.xml +2 -2
  19. package/test/json.tsx +11 -0
  20. package/test/package-lock.json +1 -1
  21. package/test/test.tsx +4 -2
  22. package/www/capacitor/config/RFIDConfig.js +14 -0
  23. package/www/capacitor/index.js +9 -7
  24. package/www/capacitor/internal/bridge.js +19 -1
  25. package/www/capacitor/rfid/CAProtocol.js +27 -0
  26. package/www/capacitor/rfid/PACEProtocol.js +24 -0
  27. package/www/cordova.js +152 -29
  28. package/www/react-native/config/RFIDConfig.js +14 -0
  29. package/www/react-native/index.js +9 -7
  30. package/www/react-native/internal/bridge.js +19 -1
  31. package/www/react-native/rfid/CAProtocol.js +27 -0
  32. package/www/react-native/rfid/PACEProtocol.js +24 -0
  33. package/www/types/config/RFIDConfig.d.ts +35 -3
  34. package/www/types/index.d.ts +3 -1
  35. package/www/types/rfid/CAProtocol.d.ts +6 -0
  36. package/www/types/rfid/PACEProtocol.d.ts +5 -0
@@ -7,6 +7,8 @@ import { PrepareProgress } from '../info/PrepareProgress'
7
7
  import { RFIDNotification } from '../rfid/RFIDNotification'
8
8
  import { PAResourcesIssuer } from '../rfid/PAResourcesIssuer'
9
9
  import { TAChallenge } from '../rfid/TAChallenge'
10
+ import { PACEProtocol } from '../rfid/PACEProtocol'
11
+ import { CAProtocol } from '../rfid/CAProtocol'
10
12
 
11
13
  const { RNDocumentReader } = NativeModules
12
14
  var eventManager = new NativeEventEmitter(RNDocumentReader)
@@ -97,8 +99,24 @@ export function _setTaCertificateCompletion(completion) {
97
99
 
98
100
  export function _setTaSignatureCompletion(completion) {
99
101
  _setEvent("ta_signature_completion", completion, json => {
100
- return [TAChallenge.fromJson(json.decode(msg)), async signature => {
102
+ return [TAChallenge.fromJson(JSON.parse(json)), async signature => {
101
103
  await exec("provideTASignature", [signature])
102
104
  }]
103
105
  })
104
106
  }
107
+
108
+ export function _setPACEProtocolCompletion(completion) {
109
+ _setEvent("paceProtocolCompletionEvent", completion, json => {
110
+ return [JSON.parse(json).map(item => PACEProtocol.fromJson(item)), async protocol => {
111
+ await exec("selectPACEProtocol", [protocol])
112
+ }]
113
+ })
114
+ }
115
+
116
+ export function _setCAProtocolCompletion(completion) {
117
+ _setEvent("caProtocolCompletionEvent", completion, json => {
118
+ return [JSON.parse(json).map(item => CAProtocol.fromJson(item)), async protocol => {
119
+ await exec("selectCAProtocol", [protocol])
120
+ }]
121
+ })
122
+ }
@@ -0,0 +1,27 @@
1
+ export class CAProtocol {
2
+ version
3
+ scheme
4
+ keyAlgorithm
5
+ chipIndividual
6
+
7
+ static fromJson(jsonObject) {
8
+ if (jsonObject == null) return null
9
+ const result = new CAProtocol()
10
+
11
+ result.version = jsonObject["version"]
12
+ result.scheme = jsonObject["scheme"]
13
+ result.keyAlgorithm = jsonObject["keyAlgorithm"]
14
+ result.chipIndividual = jsonObject["chipIndividual"]
15
+
16
+ return result
17
+ }
18
+
19
+ toJson() {
20
+ return {
21
+ "version": this.version,
22
+ "scheme": this.scheme,
23
+ "keyAlgorithm": this.keyAlgorithm,
24
+ "chipIndividual": this.chipIndividual,
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,24 @@
1
+ export class PACEProtocol {
2
+ version
3
+ stdDomainParams
4
+ keyAlgorithm
5
+
6
+ static fromJson(jsonObject) {
7
+ if (jsonObject == null) return null
8
+ const result = new PACEProtocol()
9
+
10
+ result.version = jsonObject["version"]
11
+ result.stdDomainParams = jsonObject["stdDomainParams"]
12
+ result.keyAlgorithm = jsonObject["keyAlgorithm"]
13
+
14
+ return result
15
+ }
16
+
17
+ toJson() {
18
+ return {
19
+ "version": this.version,
20
+ "stdDomainParams": this.stdDomainParams,
21
+ "keyAlgorithm": this.keyAlgorithm,
22
+ }
23
+ }
24
+ }
@@ -5,6 +5,8 @@ import { RFIDNotification } from "../rfid/RFIDNotification";
5
5
  import { PAResourcesIssuer } from "../rfid/PAResourcesIssuer";
6
6
  import { PKDCertificate } from "../rfid/PKDCertificate";
7
7
  import { TAChallenge } from "../rfid/TAChallenge";
8
+ import { PACEProtocol } from "../rfid/PACEProtocol";
9
+ import { CAProtocol } from "../rfid/CAProtocol";
8
10
 
9
11
  /**
10
12
  * A configuration file for the RFID chip processing.
@@ -49,6 +51,16 @@ export declare class RFIDConfig {
49
51
  */
50
52
  onRequestTASignature?: TaSignatureCompletion;
51
53
 
54
+ /**
55
+ * Callback for receiving RFID request data
56
+ */
57
+ onRequestPACEProtocol?: PACEProtocolCompletion;
58
+
59
+ /**
60
+ * Callback for receiving RFID request data
61
+ */
62
+ onRequestCAProtocol?: CAProtocolCompletion;
63
+
52
64
  /**
53
65
  * Regular RFID chip reading.
54
66
  *
@@ -106,12 +118,12 @@ export type ChipDetectedCompletion = () => void;
106
118
  export type RetryReadChipCompletion = (error: RFIDException) => void;
107
119
 
108
120
  /**
109
- * Callback for receiving RFID request data
121
+ * Callback for receiving RFID request data.
110
122
  */
111
123
  export type PaCertificateCompletion = (serialNumber: string, issuer: PAResourcesIssuer | null, request: PKDCertificateRequest) => void;
112
124
 
113
125
  /**
114
- * Callback for receiving RFID request data
126
+ * Callback for receiving RFID request data.
115
127
  */
116
128
  export type TaCertificateCompletion = (keyCAR: string | null, request: PKDCertificateRequest) => void;
117
129
 
@@ -121,7 +133,7 @@ export type TaCertificateCompletion = (keyCAR: string | null, request: PKDCertif
121
133
  export type PKDCertificateRequest = (certificates?: PKDCertificate[]) => Promise<void>;
122
134
 
123
135
  /**
124
- * Callback for receiving RFID request data
136
+ * Callback for receiving RFID request data.
125
137
  */
126
138
  export type TaSignatureCompletion = (challenge: TAChallenge | null, request: TASignatureRequest) => void;
127
139
 
@@ -129,3 +141,23 @@ export type TaSignatureCompletion = (challenge: TAChallenge | null, request: TAS
129
141
  * Provided to a user for passing TASignature to the native part of DocumentReader. Base64 string.
130
142
  */
131
143
  export type TASignatureRequest = (signature?: string) => Promise<void>;
144
+
145
+ /**
146
+ * Callback for receiving RFID request data.
147
+ */
148
+ export type PACEProtocolCompletion = (protocols: PACEProtocol[], request: PACEProtocolRequest) => void;
149
+
150
+ /**
151
+ * Provided to a user for choosing PACEProtocol.
152
+ */
153
+ export type PACEProtocolRequest = (protocol: PACEProtocol) => Promise<void>;
154
+
155
+ /**
156
+ * Callback for receiving RFID request data.
157
+ */
158
+ export type CAProtocolCompletion = (protocols: CAProtocol[], request: CAProtocolRequest) => void;
159
+
160
+ /**
161
+ * Provided to a user for choosing CAProtocol.
162
+ */
163
+ export type CAProtocolRequest = (protocol: CAProtocol) => Promise<void>;
@@ -133,8 +133,10 @@ import { TccParams } from './rfid/TccParams';
133
133
  import { RFIDNotification, RFIDNotificationCodes } from './rfid/RFIDNotification';
134
134
  import { PAAttribute } from './rfid/PAAttribute';
135
135
  import { TAChallenge } from './rfid/TAChallenge';
136
+ import { PACEProtocol } from './rfid/PACEProtocol';
137
+ import { CAProtocol } from './rfid/CAProtocol';
136
138
  import { PKDCertificate, PKDResourceType } from './rfid/PKDCertificate';
137
- export { PAResourcesIssuer, RFIDErrorCodes, TccParams, RFIDNotification, RFIDNotificationCodes, PAAttribute, TAChallenge, PKDCertificate, PKDResourceType };
139
+ export { PAResourcesIssuer, RFIDErrorCodes, TccParams, RFIDNotification, RFIDNotificationCodes, PAAttribute, TAChallenge, PACEProtocol, CAProtocol, PKDCertificate, PKDResourceType };
138
140
 
139
141
  import { DataRetrieval, MDLDocRequestPreset, MDLDeviceRetrieval } from './mdl/DataRetrieval';
140
142
  import { DeviceEngagement, MDLDeviceEngagement } from './mdl/DeviceEngagement';
@@ -0,0 +1,6 @@
1
+ export declare class CAProtocol {
2
+ readonly version: string;
3
+ readonly scheme: string;
4
+ readonly keyAlgorithm: string;
5
+ readonly chipIndividual: boolean;
6
+ }
@@ -0,0 +1,5 @@
1
+ export declare class PACEProtocol {
2
+ readonly version: string;
3
+ readonly stdDomainParams: string;
4
+ readonly keyAlgorithm: string;
5
+ }