2013-10-11 13:51:04 +00:00
|
|
|
/*! @file
|
|
|
|
|
|
|
|
@id $Id$
|
|
|
|
*/
|
|
|
|
// 1 2 3 4 5 6 7 8
|
|
|
|
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
|
|
|
|
2013-10-21 07:10:46 +00:00
|
|
|
#include <suisseid.hxx>
|
2013-10-11 13:51:04 +00:00
|
|
|
|
2013-10-21 07:10:46 +00:00
|
|
|
#include <mrw/args.hxx>
|
2013-10-11 13:51:04 +00:00
|
|
|
#include <stdexcept>
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
int main(int argc, char** argv) try {
|
|
|
|
|
|
|
|
std::string lib("libcvP11.so");
|
|
|
|
mrw::args::parse(argc, argv,
|
|
|
|
"Sign a text (optionally several times for performance"
|
|
|
|
" measurements).",
|
|
|
|
mrw::args::list()
|
|
|
|
<<mrw::args::decl("h", "help", "show help",
|
|
|
|
mrw::args::decl::param_list()
|
|
|
|
<<mrw::args::help()
|
|
|
|
<<mrw::args::exit())
|
|
|
|
<<mrw::args::decl("l", "library", "cryptoki lirary to load",
|
|
|
|
mrw::args::decl::param_list()
|
|
|
|
<<mrw::args::param(lib, "lib")));
|
|
|
|
|
2013-10-21 07:10:46 +00:00
|
|
|
suisseid::Cards cards(suisseid::Scanner(lib).scan());
|
|
|
|
for (suisseid::Cards::iterator card(cards.begin()); card!=cards.end(); ++card)
|
|
|
|
std::cout<<"Found SuisseID:"<<std::endl
|
|
|
|
<<" Reader Name: "<<(*card)->name()<<std::endl
|
|
|
|
<<" Version: "<<(*card)->version()<<std::endl
|
|
|
|
<<" PIN-Length: "<<(*card)->minimalPinLength()
|
|
|
|
<<" - "<<(*card)->maximalPinLength()<<std::endl;
|
2013-10-11 13:51:04 +00:00
|
|
|
return 0;
|
|
|
|
} catch (std::exception& x) {
|
|
|
|
std::cerr<<"**** ERROR in "<<*argv<<": "<<x.what()<<std::endl;
|
|
|
|
}
|