log more data in handleResponseIOS

This commit is contained in:
0xturboblitz
2024-02-12 12:24:07 +01:00
parent 4046497e29
commit f2f2c4e5ec
3 changed files with 821 additions and 826 deletions

View File

@@ -161,12 +161,17 @@ function App(): JSX.Element {
async function handleResponseIOS(response: any) {
const parsed = JSON.parse(response);
const eContentBase64 = parsed.eContentBase64; // this is what we call concatenatedDataHashes in our world
const signedAttributes = parsed.signedAttributes; // this is what we call eContent in our world
const eContentBase64 = parsed.eContentBase64; // this is what we call concatenatedDataHashes in android world
const signedAttributes = parsed.signedAttributes; // this is what we call eContent in android world
const signatureAlgorithm = parsed.signatureAlgorithm;
const mrz = parsed.passportMRZ;
const dataGroupHashes = parsed.dataGroupHashes;
const signatureBase64 = parsed.signatureBase64;
console.log('dataGroupsPresent', parsed.dataGroupsPresent)
console.log('placeOfBirth', parsed.placeOfBirth)
console.log('activeAuthenticationPassed', parsed.activeAuthenticationPassed)
console.log('isPACESupported', parsed.isPACESupported)
console.log('isChipAuthenticationSupported', parsed.isChipAuthenticationSupported)
console.log('residenceAddress', parsed.residenceAddress)
console.log('parsed.documentSigningCertificate', parsed.documentSigningCertificate)
const pem = JSON.parse(parsed.documentSigningCertificate).PEM.replace(/\\\\n/g, '\n')
@@ -184,17 +189,6 @@ function App(): JSX.Element {
const concatenatedDataHashesArray = Array.from(Buffer.from(eContentBase64, 'base64'));
const concatenatedDataHashesArraySigned = concatenatedDataHashesArray.map(byte => byte > 127 ? byte - 256 : byte);
const dgHashes = JSON.parse(dataGroupHashes);
console.log('dgHashes', dgHashes)
const dataGroupHashesArray = Object.keys(dgHashes)
.map(key => {
const dgNumber = parseInt(key.replace('DG', ''));
const hashArray = hexStringToSignedIntArray(dgHashes[key].computedHash);
return [dgNumber, hashArray];
})
.sort((a, b) => (a[0] as number) - (b[0] as number));
const encryptedDigestArray = Array.from(Buffer.from(signatureBase64, 'base64')).map(byte => byte > 127 ? byte - 256 : byte);
const passportData = {
@@ -532,8 +526,8 @@ function App(): JSX.Element {
};
return (
<YStack f={1} bg="white" h="100%" w="100%">
<YStack h="100%" w="100%">
<YStack>
<YStack>
<MainScreen
onStartCameraScan={startCameraScan}
nfcScan={scan}

View File

@@ -12,9 +12,10 @@
"dependencies": {
"@babel/plugin-transform-private-methods": "^7.23.3",
"@ethersproject/shims": "^5.7.0",
"@tamagui/config": "^1.89.10",
"@tamagui/core": "^1.89.10",
"@tamagui/lucide-icons": "^1.89.10",
"@tamagui/config": "^1.89.20",
"@tamagui/core": "^1.89.20",
"@tamagui/lucide-icons": "^1.89.20",
"@tamagui/types": "^1.89.20",
"axios": "^1.6.3",
"body-parser": "^1.20.2",
"buffer": "^6.0.3",
@@ -30,7 +31,7 @@
"react-native-passport-reader": "^1.0.3",
"react-native-svg": "13.4.0",
"react-native-toast-message": "^2.2.0",
"tamagui": "^1.89.10"
"tamagui": "^1.89.20"
},
"devDependencies": {
"@babel/core": "^7.20.0",
@@ -58,4 +59,4 @@
"engines": {
"node": ">=16"
}
}
}

File diff suppressed because it is too large Load Diff