1. Go to this page and download the library: Download itxshakil/aadhaar-offline library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// The ZIP the resident downloaded from UIDAI, plus their 4-digit share code
$kyc = $reader->fromZip($path, '1234')->verify();
// Signed XML returned by a KYC vendor's OTP flow. Still verified locally.
$kyc = $reader->fromXml($vendorResponse['raw_xml'], shareCode: '1234')->verify();
// An XML file on disk
$kyc = $reader->fromXmlFile('/path/to/offline.xml', '1234')->verify();
// The Secure QR code: pass the scanned text, a long string of digits
$kyc = $reader->fromSecureQr($scannedDigits)->verify();
// One-step shortcuts
$kyc = $reader->verifyZip($path, '1234');
$kyc = $reader->verifyXml($xml, '1234');
$kyc = $reader->verifySecureQr($scannedDigits);
use Shakil\AadhaarOffline\Exceptions\{InvalidSignatureException, StaleKycException};
try {
$kyc = $reader->verifyZip($path, $shareCode);
} catch (InvalidSignatureException) {
// Forged, edited, or signed by an untrusted key
} catch (StaleKycException) {
// Ask the resident to download a fresh file
}