Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Comments

@UgandharTalari
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant