|
|
|
@ -234,11 +234,21 @@ class SmartCardAuth: public QObject { |
|
|
|
|
#endif |
|
|
|
|
// first try to read version info
|
|
|
|
|
if (reader.transmit(0x00, 0xA4, 0x08, 0x0C, "\x3f\x00\x56\x49", 4) |
|
|
|
|
!= std::string("\x90\x00", 2) || !reader) return -2; |
|
|
|
|
!= std::string("\x90\x00", 2) || !reader) { |
|
|
|
|
qDebug()<<"Select File failed"; |
|
|
|
|
return -2; |
|
|
|
|
} |
|
|
|
|
std::string res(reader.transmit(0x00, 0xB0, 0x00, 0x00)); |
|
|
|
|
qDebug()<<" T E X T I S : "<<res.substr(6, res[5]).c_str(); |
|
|
|
|
if (res.substr(0, 2)!=std::string("\x90\x00", 2) || |
|
|
|
|
res.substr(6, res[5]) == "PZ2007") return -2; |
|
|
|
|
if (res.substr(res.size()-2)!=std::string("\x90\x00", 2)) { |
|
|
|
|
qDebug()<<"read error"; |
|
|
|
|
return -2; |
|
|
|
|
} |
|
|
|
|
qDebug()<<"version text is: "<<res.substr(4, res[3]).c_str(); |
|
|
|
|
// if (res.substr(4, res[3]) != "RAPost 2009" &&
|
|
|
|
|
// res.substr(4, res[3]) != "RAPost 2010") {
|
|
|
|
|
// qDebug()<<"unsupported card";
|
|
|
|
|
// return -2;
|
|
|
|
|
// }
|
|
|
|
|
if (retCode(reader.transmit(0x00, 0xA4, 0x00, 0x0C)) == 0x9000) { |
|
|
|
|
int value(retCode(reader.transmit(0x00, 0x20, 0x00, 0x81))); |
|
|
|
|
if ((value&0x63C0)==0x63C0) return value&0x0F; |
|
|
|
|