read attributes - in test
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user