read attributes - in test

This commit is contained in:
Marc Wäckerlin
2009-09-02 08:45:49 +00:00
parent 1e903b58e4
commit f3645efc8c
2 changed files with 200 additions and 27 deletions

View File

@@ -69,9 +69,19 @@ int main(int argc, char const*const*const argv) try {
<<"flags: \""<<mechinfo.flags<<'"'<<std::endl;
}
cryptoki::Session session(*it);
std::cout<<"-------------------- Objects -----------------"<<std::endl;
cryptoki::ObjectList objs(session.find());
std::cout<<"Objects Found: "<<objs.size()<<std::endl;
for (cryptoki::ObjectList::iterator it(objs.begin());
it!=objs.end(); ++it) {
cryptoki::AttributeMap attrs(it->getattributevalue());
for (cryptoki::AttributeMap::iterator it(attrs.begin());
it!=attrs.end(); ++it) {
std::cout<<"-------------------- Object -----------------"<<std::endl
<<"id: \""<<it->second.type<<'"'<<std::endl
<<"name: \""<<it->second.name()<<'"'<<std::endl
<<"value: \""<<it->second.value<<'"'<<std::endl;
}
}
} catch (std::exception& x) {
std::cerr<<"**** FEHLER in "<<*argv<<": "<<x.what()<<std::endl;
}