Digital Signature Verification failed using SHA256withRSA in Python

后端 未结 3 1158
清酒与你
清酒与你 2021-01-14 07:28

I am trying to validate the digital signature with given certificate files for the offline aadhaar KYC verification application.

This instruction is given in the docu

3条回答
  •  滥情空心
    2021-01-14 07:56

    More about XML signing here

    Python Code for Digital Signature verification for new Aadhar XML:

    certificate_file  = "uidai_offline_publickey_19062019.cer"
    aadhar_file = "offlineaadhaar20200120032019978.xml"
    certificate = open(certificate_file, "rb").read()
    aadhar_xml = open(aadhar_file, "rb").read()
    from signxml import XMLSigner, XMLVerifier
    try:
        verify_result = XMLVerifier().verify(aadhar_xml, x509_cert=certificate)
        # return True
    except Exception as e: 
        verify_result = None
        # return False
        print(e)
    

    You can download the certificate from here.

    More about signxml here.

提交回复
热议问题