You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I am trying to validate signature in the secure QR code but I am getting false value. I used the above certificates and [uidai_12_06_18_cer.cer](https://www.uidai.gov.in/images/authDoc/uidai_12_06_18_cer.cer).
#22
Open
UgandharTalari opened this issue
Aug 2, 2022
· 0 comments
signature verification method
Signature signature = Signature.getInstance("SHA256withRSA");
InputStream in = getAssets().open("uidai.cer");
CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
X509Certificate cer = (X509Certificate) certFactory.generateCertificate(in);
PublicKey publicKey = cer.getPublicKey();
in.close();
signature.initVerify(publicKey);
signature.update(dataSigned);
isVerified = signature.verify(signArray); END__
I followed same validation steps given in the UIDAI pdf https://uidai.gov.in/images/resource/User_manulal_QR_Code_15032019.pdf.
can any help me to figure out the mistake I am making.
Thanks in advance.
Hi I am trying to validate signature in the secure QR code but I am getting false value. I used the above certificates and uidai_12_06_18_cer.cer.
code of getting signature value__
for(int i=0,j = output.length-1; i<256 & j >= output.length-256 ; i++,j--){
signArray[i] = output[j];
}
END__
signature verification method
Signature signature = Signature.getInstance("SHA256withRSA");
InputStream in = getAssets().open("uidai.cer");
CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
X509Certificate cer = (X509Certificate) certFactory.generateCertificate(in);
PublicKey publicKey = cer.getPublicKey();
in.close();
signature.initVerify(publicKey);
signature.update(dataSigned);
isVerified = signature.verify(signArray);
END__
I followed same validation steps given in the UIDAI pdf https://uidai.gov.in/images/resource/User_manulal_QR_Code_15032019.pdf.
can any help me to figure out the mistake I am making.
Thanks in advance.
Originally posted by @UgandharTalari in #6 (comment)
The text was updated successfully, but these errors were encountered: