store dg2 hash in the passport data on android

This commit is contained in:
turnoffthiscomputer
2024-11-16 02:01:22 +07:00
parent a4513f97bf
commit 42a5d48cdc

View File

@@ -230,13 +230,17 @@ const handleResponseAndroid = async (
LDSVersion,
unicodeVersion,
encapContent,
documentSigningCertificate
documentSigningCertificate,
dataGroupHashes
} = response;
const dgHashesObj = JSON.parse(dataGroupHashes);
const dg2Hash = dgHashesObj["2"]; // This will give you the DG2 hash
const pem = "-----BEGIN CERTIFICATE-----" + documentSigningCertificate + "-----END CERTIFICATE-----"
const passportData: PassportData = {
mrz: mrz.replace(/\n/g, ''),
dsc: pem,
dg2Hash,
eContent: JSON.parse(encapContent),
signedAttr: JSON.parse(eContent),
encryptedDigest: JSON.parse(encryptedDigest),