@regulaforensics/document-reader 9.4.707-rc → 9.4.710-beta
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/RNDocumentReader.podspec +2 -2
- package/android/build.gradle +2 -2
- package/android/cordova.gradle +2 -2
- package/android/src/main/java/com/regula/plugin/documentreader/JSONConstructor.kt +36 -0
- package/android/src/main/java/com/regula/plugin/documentreader/Main.kt +46 -43
- package/examples/capacitor/package.json +1 -1
- package/examples/ionic/package.json +1 -1
- package/examples/react_native/package.json +1 -1
- package/ios/RGLWJSONConstructor.h +4 -0
- package/ios/RGLWJSONConstructor.m +93 -47
- package/ios/RGLWMain.h +2 -4
- package/ios/RGLWMain.m +49 -13
- package/ios/RNDocumentReader.m +2 -0
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/test/json.tsx +11 -0
- package/test/package-lock.json +1 -1
- package/test/test.tsx +4 -2
- package/www/capacitor/config/RFIDConfig.js +14 -0
- package/www/capacitor/index.js +9 -7
- package/www/capacitor/internal/bridge.js +19 -1
- package/www/capacitor/rfid/CAProtocol.js +27 -0
- package/www/capacitor/rfid/PACEProtocol.js +24 -0
- package/www/cordova.js +152 -29
- package/www/react-native/config/RFIDConfig.js +14 -0
- package/www/react-native/index.js +9 -7
- package/www/react-native/internal/bridge.js +19 -1
- package/www/react-native/rfid/CAProtocol.js +27 -0
- package/www/react-native/rfid/PACEProtocol.js +24 -0
- package/www/types/config/RFIDConfig.d.ts +35 -3
- package/www/types/index.d.ts +3 -1
- package/www/types/rfid/CAProtocol.d.ts +6 -0
- package/www/types/rfid/PACEProtocol.d.ts +5 -0
package/ios/RGLWMain.m
CHANGED
|
@@ -41,12 +41,14 @@
|
|
|
41
41
|
@"recognize": ^{ [self recognize :args[0]]; },
|
|
42
42
|
@"startNewPage": ^{ [self startNewPage]; },
|
|
43
43
|
@"stopScanner": ^{ [self stopScanner]; },
|
|
44
|
-
@"startRFIDReader": ^{ [self startRFIDReader :args[0]
|
|
45
|
-
@"readRFID": ^{ [self readRFID :args[0]
|
|
44
|
+
@"startRFIDReader": ^{ [self startRFIDReader :args[0]]; },
|
|
45
|
+
@"readRFID": ^{ [self readRFID :args[0]]; },
|
|
46
46
|
@"stopRFIDReader": ^{ [self stopRFIDReader]; },
|
|
47
47
|
@"providePACertificates": ^{ [self providePACertificates :args[0]]; },
|
|
48
48
|
@"provideTACertificates": ^{ [self provideTACertificates :args[0]]; },
|
|
49
49
|
@"provideTASignature": ^{ [self provideTASignature :args[0]]; },
|
|
50
|
+
@"selectPACEProtocol": ^{ [self selectPACEProtocol :args[0]]; },
|
|
51
|
+
@"selectCAProtocol": ^{ [self selectCAProtocol :args[0]]; },
|
|
50
52
|
@"setTCCParams": ^{ [self setTCCParams :args[0] :callback]; },
|
|
51
53
|
@"addPKDCertificates": ^{ [self addPKDCertificates :args[0]]; },
|
|
52
54
|
@"clearPKDCertificates": ^{ [self clearPKDCertificates]; },
|
|
@@ -249,19 +251,15 @@ static NSDictionary* headers;
|
|
|
249
251
|
});
|
|
250
252
|
}
|
|
251
253
|
|
|
252
|
-
+(void)startRFIDReader:(
|
|
253
|
-
|
|
254
|
-
this.doRequestTACertificates = taCert;
|
|
255
|
-
this.doRequestTASignature = taSig;
|
|
254
|
+
+(void)startRFIDReader:(NSDictionary*)config {
|
|
255
|
+
rfidReaderRequest = config;
|
|
256
256
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
257
257
|
[RGLDocReader.shared startRFIDReaderFromPresenter:RGLWRootViewController() completion:[self completion]];
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
+(void)readRFID:(
|
|
262
|
-
|
|
263
|
-
this.doRequestTACertificates = taCert;
|
|
264
|
-
this.doRequestTASignature = taSig;
|
|
261
|
+
+(void)readRFID:(NSDictionary*)config {
|
|
262
|
+
rfidReaderRequest = config;
|
|
265
263
|
[RGLDocReader.shared readRFID:^(RGLRFIDNotificationAction notificationAction, RGLRFIDNotify* _Nullable notification) {
|
|
266
264
|
if (notification != nil) sendEvent(rfidOnProgressEvent, [RGLWJSONConstructor generateDocumentReaderNotification:notification]);
|
|
267
265
|
} completion :^(RGLRFIDCompleteAction action, RGLDocumentReaderResults * _Nullable results, NSError * _Nullable error, RGLRFIDErrorCodes errorCode) {
|
|
@@ -291,6 +289,14 @@ static NSDictionary* headers;
|
|
|
291
289
|
taSignatureCompletion([RGLWJSONConstructor base64Decode:signature]);
|
|
292
290
|
}
|
|
293
291
|
|
|
292
|
+
+(void)selectPACEProtocol:(NSDictionary*)protocol {
|
|
293
|
+
paceProtocolCompletion([RGLWJSONConstructor paceProtocolFromJson:protocol]);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
+(void)selectCAProtocol:(NSDictionary*)protocol {
|
|
297
|
+
caProtocolCompletion([RGLWJSONConstructor caProtocolFromJson:protocol]);
|
|
298
|
+
}
|
|
299
|
+
|
|
294
300
|
+(void)setTCCParams:(NSDictionary*)params :(RGLWCallback)callback {
|
|
295
301
|
[RGLDocReader.shared setTCCParams:[RGLWJSONConstructor tccParamsFromJson:params] completion:^(BOOL success, NSError * _Nullable error) {
|
|
296
302
|
callback([RGLWJSONConstructor generateSuccessCompletion:success :error]);
|
|
@@ -626,9 +632,13 @@ RGLWCallback savedCallbackForBluetoothResult;
|
|
|
626
632
|
RGLRFIDCertificatesCallback paCertificateCompletion;
|
|
627
633
|
RGLRFIDCertificatesCallback taCertificateCompletion;
|
|
628
634
|
RGLWRFIDSignatureCallback taSignatureCompletion;
|
|
635
|
+
RGLRFIDAccessControlPACECallback paceProtocolCompletion;
|
|
636
|
+
RGLRFIDAccessControlCACallback caProtocolCompletion;
|
|
637
|
+
|
|
638
|
+
NSDictionary* rfidReaderRequest;
|
|
629
639
|
|
|
630
640
|
- (void)onRequestPACertificatesWithSerial:(NSData *)serialNumber issuer:(RGLPAResourcesIssuer *)issuer callback:(RGLRFIDCertificatesCallback)callback {
|
|
631
|
-
if([
|
|
641
|
+
if ([rfidReaderRequest[@"paCertificates"] boolValue]) {
|
|
632
642
|
paCertificateCompletion = callback;
|
|
633
643
|
sendEvent(paCertificateCompletionEvent, [RGLWJSONConstructor generatePACertificateCompletion:serialNumber :issuer]);
|
|
634
644
|
} else {
|
|
@@ -638,7 +648,7 @@ RGLWRFIDSignatureCallback taSignatureCompletion;
|
|
|
638
648
|
}
|
|
639
649
|
|
|
640
650
|
- (void)onRequestTACertificatesWithKey:(NSString *)keyCAR callback:(RGLRFIDCertificatesCallback)callback {
|
|
641
|
-
if([
|
|
651
|
+
if ([rfidReaderRequest[@"taCertificates"] boolValue]) {
|
|
642
652
|
taCertificateCompletion = callback;
|
|
643
653
|
sendEvent(taCertificateCompletionEvent, keyCAR);
|
|
644
654
|
} else {
|
|
@@ -648,7 +658,7 @@ RGLWRFIDSignatureCallback taSignatureCompletion;
|
|
|
648
658
|
}
|
|
649
659
|
|
|
650
660
|
- (void)onRequestTASignatureWithChallenge:(RGLTAChallenge *)challenge callback:(void(^)(NSData *signature))callback {
|
|
651
|
-
if([
|
|
661
|
+
if ([rfidReaderRequest[@"taSignature"] boolValue]) {
|
|
652
662
|
taSignatureCompletion = callback;
|
|
653
663
|
sendEvent(taSignatureCompletionEvent, [RGLWJSONConstructor dictToString: [RGLWJSONConstructor generateTAChallenge:challenge]]);
|
|
654
664
|
} else {
|
|
@@ -657,6 +667,32 @@ RGLWRFIDSignatureCallback taSignatureCompletion;
|
|
|
657
667
|
}
|
|
658
668
|
}
|
|
659
669
|
|
|
670
|
+
- (void)onRequestPACEProtocolWithOptions:(NSArray<RGLRFIDAccessControlPACE*>*)protocols callback:(RGLRFIDAccessControlPACECallback)callback {
|
|
671
|
+
if ([rfidReaderRequest[@"paceProtocol"] boolValue]) {
|
|
672
|
+
paceProtocolCompletion = callback;
|
|
673
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
674
|
+
for(RGLRFIDAccessControlPACE* item in protocols)
|
|
675
|
+
[array addObject:[RGLWJSONConstructor generatePaceProtocol:item]];
|
|
676
|
+
sendEvent(paceProtocolCompletionEvent, [RGLWJSONConstructor arrayToString: array]);
|
|
677
|
+
} else {
|
|
678
|
+
paceProtocolCompletion = nil;
|
|
679
|
+
callback(nil);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
- (void)onRequestCAProtocolWithOptions:(NSArray<RGLRFIDAccessControlCA*>*)protocols callback:(RGLRFIDAccessControlCACallback)callback {
|
|
684
|
+
if ([rfidReaderRequest[@"caProtocol"] boolValue]) {
|
|
685
|
+
caProtocolCompletion = callback;
|
|
686
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
687
|
+
for(RGLRFIDAccessControlCA* item in protocols)
|
|
688
|
+
[array addObject:[RGLWJSONConstructor generateCaProtocol:item]];
|
|
689
|
+
sendEvent(caProtocolCompletionEvent, [RGLWJSONConstructor arrayToString: array]);
|
|
690
|
+
} else {
|
|
691
|
+
caProtocolCompletionEvent = nil;
|
|
692
|
+
callback(nil);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
|
|
660
696
|
- (void)didChipConnected {
|
|
661
697
|
sendEvent(rfidOnChipDetectedEvent, @"");
|
|
662
698
|
}
|
package/ios/RNDocumentReader.m
CHANGED
|
@@ -18,6 +18,8 @@ static NSMutableArray<RCTResponseSenderBlock>* _firedCallbacks = nil;
|
|
|
18
18
|
paCertificateCompletionEvent,
|
|
19
19
|
taCertificateCompletionEvent,
|
|
20
20
|
taSignatureCompletionEvent,
|
|
21
|
+
paceProtocolCompletionEvent,
|
|
22
|
+
caProtocolCompletionEvent,
|
|
21
23
|
drVideoEncoderCompletionEvent,
|
|
22
24
|
drOnCustomButtonTappedEvent];
|
|
23
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/document-reader",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.710-beta",
|
|
4
4
|
"description": "This is an npm module for Regula Document Reader SDK. It allows you to read various kinds of identification documents using your phone's camera.",
|
|
5
5
|
"main": "www/react-native/index.js",
|
|
6
6
|
"module": "www/capacitor/index.js",
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="@regulaforensics/document-reader" version="9.4.
|
|
2
|
+
<plugin id="@regulaforensics/document-reader" version="9.4.710-beta" xmlns="http://apache.org/cordova/ns/plugins/1.0">
|
|
3
3
|
<name>DocumentReader</name>
|
|
4
4
|
<description>Cordova plugin for Regula Document Reader SDK</description>
|
|
5
5
|
<license>commercial</license>
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<source url="https://github.com/CocoaPods/Specs.git" />
|
|
30
30
|
</config>
|
|
31
31
|
<pods>
|
|
32
|
-
<pod name="
|
|
32
|
+
<pod name="DocumentReader" spec="9.3.6137" />
|
|
33
33
|
</pods>
|
|
34
34
|
</podspec>
|
|
35
35
|
</platform>
|
package/test/json.tsx
CHANGED
|
@@ -980,6 +980,17 @@ export var taChallenge = {
|
|
|
980
980
|
"hashPK": "test3",
|
|
981
981
|
"idPICC": "test4",
|
|
982
982
|
};
|
|
983
|
+
export var paceProtocol = {
|
|
984
|
+
"version": "123",
|
|
985
|
+
"stdDomainParams": "test2",
|
|
986
|
+
"keyAlgorithm": "test3",
|
|
987
|
+
};
|
|
988
|
+
export var caProtocol = {
|
|
989
|
+
"version": "123",
|
|
990
|
+
"scheme": "test2",
|
|
991
|
+
"keyAlgorithm": "test3",
|
|
992
|
+
"chipIndividual": true,
|
|
993
|
+
};
|
|
983
994
|
export var tccParams = {
|
|
984
995
|
"serviceUrlTA": "test1",
|
|
985
996
|
"serviceUrlPA": "test2",
|
package/test/package-lock.json
CHANGED
package/test/test.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { compare } from './utils'
|
|
2
|
-
import { AccessControlProcedureType, Application, Attribute, AuthenticityCheck, AuthenticityElement, AuthenticityParams, AuthenticityResult, Authority, BackendProcessingConfig, Bsi, BarcodeField, BarcodeResult, BytesData, CardProperties, CertificateChain, CertificateData, Comparison, Coordinate, Customization, CustomizationColors, CustomizationFonts, CustomizationImages, CustomizationTimings, CustomizationMatrices, CustomizationContentModes, DataField, DocReaderException, DocReaderScenario, DocReaderVersion, DocumentsDatabase, DocumentType, EDLDataGroups, EIDDataGroups, DTCDataGroup, EPassportDataGroups, Extension, FaceApiParams, FaceApiSearchParams, File, FileData, Functionality, GlaresCheckParams, RFIDParams, GraphicField, GraphicResult, ImageInputData, ImageQA, ImageQuality, ImageQualityGroup, InitConfig, License, LivenessParams, OnlineProcessingConfig, OpticalStatus, PAAttribute, PAResourcesIssuer, PDF417Info, PKDCertificate, Position, PrepareProgress, ProcessParams, RecognizeConfig, Rect, Results, ResultsStatus, RFIDException, RFIDNotification, RFIDOrigin, RFIDScenario, RFIDSessionData, AgeStatus, RFIDStatus, RFIDValidity, RFIDValue, ScannerConfig, SecurityObject, SecurityObjectCertificates, SignerInfo, Symbol, TAChallenge, TccParams, TextField, TextResult, TextSource, TransactionInfo, Validity, Value, VDSNCData, VDSData, DocFeature, DeviceRetrievalMethod, DocumentRequest18013MDL, DataRetrieval, DeviceEngagement, NameSpaceMDL, DocumentRequestMDL, FinalizeConfig } from '@regulaforensics/document-reader/www/capacitor'
|
|
3
|
-
import { accessControlProcedureType, application, attribute, authenticityCheck, authenticityElement, authenticityParams, authenticityResult, authority, backendProcessingConfig, bsi, barcodeField, barcodeResult, bytesData, cardProperties, certificateChain, certificateData, comparison, coordinate, customization, customizationColors, customizationFonts, customizationImages, customizationTimings, customizationMatrices, customizationContentModes, dataField, docReaderException, docReaderScenario, docReaderVersion, documentsDatabase, documentType, eDLDataGroups, eIDDataGroups, dtcDataGroup, ePassportDataGroups, extension, faceApiParams, faceApiSearchParams, file, fileData, functionality, glaresCheckParams, rfidParams, graphicField, graphicResult, imageInputData, imageQA, imageQuality, imageQualityGroup, initConfig, license, livenessParams, onlineProcessingConfig, opticalStatus, paAttribute, paResourcesIssuer, pdf417Info, pkdCertificate, position, prepareProgress, processParams, recognizeConfig, recognizeConfig2, rect, results, resultsStatus, rfidException, rfidNotification, rfidOrigin, rfidScenario, rfidSessionData, ageStatus, rfidStatus, rfidValidity, rfidValue, scannerConfig, securityObject, securityObjectCertificates, signerInfo, symbol, taChallenge, tccParams, textField, textResult, textSource, transactionInfo, validity, value, vdsncData, vdsData, docFeature, deviceRetrievalMethod, documentRequest18013MDL, dataRetrieval, deviceEngagement, nameSpaceMDL, documentRequestMDL, finalizeConfig } from './json'
|
|
2
|
+
import { AccessControlProcedureType, Application, Attribute, AuthenticityCheck, AuthenticityElement, AuthenticityParams, AuthenticityResult, Authority, BackendProcessingConfig, Bsi, BarcodeField, BarcodeResult, BytesData, CardProperties, CertificateChain, CertificateData, Comparison, Coordinate, Customization, CustomizationColors, CustomizationFonts, CustomizationImages, CustomizationTimings, CustomizationMatrices, CustomizationContentModes, DataField, DocReaderException, DocReaderScenario, DocReaderVersion, DocumentsDatabase, DocumentType, EDLDataGroups, EIDDataGroups, DTCDataGroup, EPassportDataGroups, Extension, FaceApiParams, FaceApiSearchParams, File, FileData, Functionality, GlaresCheckParams, RFIDParams, GraphicField, GraphicResult, ImageInputData, ImageQA, ImageQuality, ImageQualityGroup, InitConfig, License, LivenessParams, OnlineProcessingConfig, OpticalStatus, PAAttribute, PAResourcesIssuer, PDF417Info, PKDCertificate, PACEProtocol, CAProtocol, Position, PrepareProgress, ProcessParams, RecognizeConfig, Rect, Results, ResultsStatus, RFIDException, RFIDNotification, RFIDOrigin, RFIDScenario, RFIDSessionData, AgeStatus, RFIDStatus, RFIDValidity, RFIDValue, ScannerConfig, SecurityObject, SecurityObjectCertificates, SignerInfo, Symbol, TAChallenge, TccParams, TextField, TextResult, TextSource, TransactionInfo, Validity, Value, VDSNCData, VDSData, DocFeature, DeviceRetrievalMethod, DocumentRequest18013MDL, DataRetrieval, DeviceEngagement, NameSpaceMDL, DocumentRequestMDL, FinalizeConfig } from '@regulaforensics/document-reader/www/capacitor'
|
|
3
|
+
import { accessControlProcedureType, application, attribute, authenticityCheck, authenticityElement, authenticityParams, authenticityResult, authority, backendProcessingConfig, bsi, barcodeField, barcodeResult, bytesData, cardProperties, certificateChain, certificateData, comparison, coordinate, customization, customizationColors, customizationFonts, customizationImages, customizationTimings, customizationMatrices, customizationContentModes, dataField, docReaderException, docReaderScenario, docReaderVersion, documentsDatabase, documentType, eDLDataGroups, eIDDataGroups, dtcDataGroup, ePassportDataGroups, extension, faceApiParams, faceApiSearchParams, file, fileData, functionality, glaresCheckParams, rfidParams, graphicField, graphicResult, imageInputData, imageQA, imageQuality, imageQualityGroup, initConfig, license, livenessParams, onlineProcessingConfig, opticalStatus, paAttribute, paResourcesIssuer, pdf417Info, pkdCertificate, paceProtocol, caProtocol, position, prepareProgress, processParams, recognizeConfig, recognizeConfig2, rect, results, resultsStatus, rfidException, rfidNotification, rfidOrigin, rfidScenario, rfidSessionData, ageStatus, rfidStatus, rfidValidity, rfidValue, scannerConfig, securityObject, securityObjectCertificates, signerInfo, symbol, taChallenge, tccParams, textField, textResult, textSource, transactionInfo, validity, value, vdsncData, vdsData, docFeature, deviceRetrievalMethod, documentRequest18013MDL, dataRetrieval, deviceEngagement, nameSpaceMDL, documentRequestMDL, finalizeConfig } from './json'
|
|
4
4
|
|
|
5
5
|
compare('initConfig', initConfig, InitConfig.fromJson)
|
|
6
6
|
compare('onlineProcessingConfig', onlineProcessingConfig, OnlineProcessingConfig.fromJson)
|
|
@@ -98,6 +98,8 @@ compare('paAttribute', paAttribute, PAAttribute.fromJson)
|
|
|
98
98
|
compare('paResourcesIssuer', paResourcesIssuer, PAResourcesIssuer.fromJson)
|
|
99
99
|
compare('pkdCertificate', pkdCertificate, PKDCertificate.fromJson)
|
|
100
100
|
compare('taChallenge', taChallenge, TAChallenge.fromJson)
|
|
101
|
+
compare('paceProtocol', paceProtocol, PACEProtocol.fromJson);
|
|
102
|
+
compare('caProtocol', caProtocol, CAProtocol.fromJson);
|
|
101
103
|
compare('tccParams', tccParams, TccParams.fromJson)
|
|
102
104
|
|
|
103
105
|
compare('deviceRetrievalMethod', deviceRetrievalMethod, DeviceRetrievalMethod.fromJson)
|
|
@@ -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
|
export class RFIDConfig {
|
|
10
12
|
_completion
|
|
@@ -16,6 +18,8 @@ export class RFIDConfig {
|
|
|
16
18
|
onRequestPACertificates
|
|
17
19
|
onRequestTACertificates
|
|
18
20
|
onRequestTASignature
|
|
21
|
+
onRequestPACEProtocol
|
|
22
|
+
onRequestCAProtocol
|
|
19
23
|
|
|
20
24
|
constructor(completion) {
|
|
21
25
|
this._completion = completion
|
|
@@ -28,4 +32,14 @@ export class RFIDConfig {
|
|
|
28
32
|
result._disableUI = true
|
|
29
33
|
return result
|
|
30
34
|
}
|
|
35
|
+
|
|
36
|
+
toJson() {
|
|
37
|
+
return {
|
|
38
|
+
"paCertificates": this.onRequestPACertificates != null,
|
|
39
|
+
"taCertificates": this.onRequestTACertificates != null,
|
|
40
|
+
"taSignature": this.onRequestTASignature != null,
|
|
41
|
+
"paceProtocol": this.onRequestPACEProtocol != null,
|
|
42
|
+
"caProtocol": this.onRequestCAProtocol != null,
|
|
43
|
+
}
|
|
44
|
+
}
|
|
31
45
|
}
|
package/www/capacitor/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { exec, serializeInterface, _setDocumentReaderCompletion, _setRFIDCompletion, _setDocumentReaderPrepareCompletion, _setCustomButtonTappedCompletion, _setVideoEncoderCompletion, _setRFIDProgressCompletion, _setChipDetectedCompletion, _setRetryReadChipCompletion, _setPaCertificateCompletion, _setTaCertificateCompletion, _setTaSignatureCompletion } from './internal/bridge'
|
|
1
|
+
import { exec, serializeInterface, _setDocumentReaderCompletion, _setRFIDCompletion, _setDocumentReaderPrepareCompletion, _setCustomButtonTappedCompletion, _setVideoEncoderCompletion, _setRFIDProgressCompletion, _setChipDetectedCompletion, _setRetryReadChipCompletion, _setPaCertificateCompletion, _setTaCertificateCompletion, _setTaSignatureCompletion, _setPACEProtocolCompletion, _setCAProtocolCompletion } from './internal/bridge'
|
|
2
2
|
|
|
3
3
|
import { OnlineProcessingConfig, ImageFormat, OnlineMode } from './config/OnlineProcessingConfig';
|
|
4
4
|
import { InitConfig } from './config/InitConfig';
|
|
@@ -135,8 +135,10 @@ import { TccParams } from './rfid/TccParams';
|
|
|
135
135
|
import { RFIDNotification, RFIDNotificationCodes } from './rfid/RFIDNotification';
|
|
136
136
|
import { PAAttribute } from './rfid/PAAttribute';
|
|
137
137
|
import { TAChallenge } from './rfid/TAChallenge';
|
|
138
|
+
import { PACEProtocol } from './rfid/PACEProtocol';
|
|
139
|
+
import { CAProtocol } from './rfid/CAProtocol';
|
|
138
140
|
import { PKDCertificate, PKDResourceType } from './rfid/PKDCertificate';
|
|
139
|
-
export { PAResourcesIssuer, RFIDErrorCodes, TccParams, RFIDNotification, RFIDNotificationCodes, PAAttribute, TAChallenge, PKDCertificate, PKDResourceType };
|
|
141
|
+
export { PAResourcesIssuer, RFIDErrorCodes, TccParams, RFIDNotification, RFIDNotificationCodes, PAAttribute, TAChallenge, PACEProtocol, CAProtocol, PKDCertificate, PKDResourceType };
|
|
140
142
|
|
|
141
143
|
import { DataRetrieval, MDLDocRequestPreset, MDLDeviceRetrieval } from './mdl/DataRetrieval';
|
|
142
144
|
import { DeviceEngagement, MDLDeviceEngagement } from './mdl/DeviceEngagement';
|
|
@@ -339,15 +341,15 @@ export class DocumentReader {
|
|
|
339
341
|
_setRFIDProgressCompletion(config.onProgress);
|
|
340
342
|
_setChipDetectedCompletion(config.onChipDetected);
|
|
341
343
|
_setRetryReadChipCompletion(config.onRetryReadChip);
|
|
344
|
+
|
|
342
345
|
_setPaCertificateCompletion(config.onRequestPACertificates);
|
|
343
346
|
_setTaCertificateCompletion(config.onRequestTACertificates);
|
|
344
347
|
_setTaSignatureCompletion(config.onRequestTASignature);
|
|
345
348
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
]);
|
|
349
|
+
_setPACEProtocolCompletion(config.onRequestPACEProtocol);
|
|
350
|
+
_setCAProtocolCompletion(config.onRequestCAProtocol);
|
|
351
|
+
|
|
352
|
+
exec(config._disableUI ? "readRFID" : "startRFIDReader", [config.toJson()]);
|
|
351
353
|
}
|
|
352
354
|
|
|
353
355
|
stopScanner() {
|
|
@@ -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(
|
|
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
|
+
}
|