add new commnds to read CardOS Version
This commit is contained in:
@@ -52,7 +52,9 @@ class Commands: public cardos::Commands {
|
|||||||
<<" (l)ogonpu(k) <pin> logon with user PUK"<<std::endl
|
<<" (l)ogonpu(k) <pin> logon with user PUK"<<std::endl
|
||||||
<<" (l)ogon(s)igg <pin> logon with SigG PIN"<<std::endl
|
<<" (l)ogon(s)igg <pin> logon with SigG PIN"<<std::endl
|
||||||
<<" (l)ogon(t)transport <pin> logon with transport PIN"<<std::endl
|
<<" (l)ogon(t)transport <pin> logon with transport PIN"<<std::endl
|
||||||
<<" (g)et(p)in(l)engths get PIN min max lengths"<<std::endl
|
<<" (g)et(p)in(l)engths get PIN min max lengths"<<std::endl
|
||||||
|
<<" (c)hip get chip production data"<<std::endl
|
||||||
|
<<" (v)ersion get product data"<<std::endl
|
||||||
<<"Note: \"(h)elp\" means: type \"help\" or simply \"h\""<<std::endl;
|
<<"Note: \"(h)elp\" means: type \"help\" or simply \"h\""<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,6 +88,8 @@ class Commands: public cardos::Commands {
|
|||||||
else if (cmd=="logontransport"||cmd=="lt") logonTransport(pin());
|
else if (cmd=="logontransport"||cmd=="lt") logonTransport(pin());
|
||||||
else if (cmd=="getpinlengths"||cmd=="gpl") getPinLengths();
|
else if (cmd=="getpinlengths"||cmd=="gpl") getPinLengths();
|
||||||
else if (cmd=="print"||cmd=="p") std::cout<<_ber.print()<<std::endl;
|
else if (cmd=="print"||cmd=="p") std::cout<<_ber.print()<<std::endl;
|
||||||
|
else if (cmd=="chip"||cmd=="c") printDataChipProduction();
|
||||||
|
else if (cmd=="version"||cmd=="v") std::cout<<getDataProductName()<<std::endl;
|
||||||
else help();
|
else help();
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
std::cout<<"**** Error: "<<e.what()<<std::endl;
|
std::cout<<"**** Error: "<<e.what()<<std::endl;
|
||||||
@@ -126,6 +130,13 @@ class Commands: public cardos::Commands {
|
|||||||
<<"-"<<record[0][2][0][4].ulong()<<std::endl;
|
<<"-"<<record[0][2][0][4].ulong()<<std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void printDataChipProduction() {
|
||||||
|
ChipProductionData data=getDataChipProduction();
|
||||||
|
std::cout<<"serial: "<<crypto::hex(data.serial)<<std::endl
|
||||||
|
<<"type: "<<crypto::hex(std::string(1, data.type))<<std::endl
|
||||||
|
<<"id: "<<crypto::hex(data.id)<<std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user