/*! @file @id $Id$ */ // 1 2 3 4 5 6 7 8 // 45678901234567890123456789012345678901234567890123456789012345678901234567890 #include #include #include #include #include void show(const QString& s, const std::string& p="item: ") { std::cout<toUtf8()).toStdString()<name()<version()<minimalPinLength() <<" - "<<(*card)->maximalPinLength()<pkcs15PinRetries()<sigGPinRetries()<transportPinRetries()<pukRetries()<sessionInfo()); std::cout<<" Session:"<certificates()); std::cout<<" Certificates: "<>choice; // small user menu try { if (choice=="n") { // handled above in the while-loop } else if (choice=="c") { // run a check of the card status TextualCycle check(*card); if (check.run()) std::cout<<"----> SuisseID is fine"< SuisseID is bad"<>oldpin; std::cout<<"Enter New PIN: "; std::cin>>newpin; if (oldpin.size() && newpin.size()) (*card)->changePins(newpin, oldpin); } else if (choice=="i") { // install new certificates - not fully implemented TextualCycle check(*card); check.installCerts(true); } else if (choice=="z") { // show all certificates on the card for (suisseid::Certificates::iterator cert(certs.begin()); cert!=certs.end(); ++cert) { show(*cert); } } else if (choice=="a") { // show authentication certificate only show((*card)->authenticationCertificate()); } else if (choice=="d") { // show authentication certificate only show((*card)->digitalSignatureCertificate()); } else if (choice=="q") { // done, user quits return 0; } else { // unknown user command std::cout<<"I beg your pardon, Sir?"<