attributes read

This commit is contained in:
Marc Wäckerlin
2009-09-02 13:57:56 +00:00
parent f3645efc8c
commit 0c7be56e21
2 changed files with 120 additions and 37 deletions

View File

@@ -39,7 +39,8 @@ int main(int argc, char const*const*const argv) try {
<<"label: \""<<info.label<<'"'<<std::endl
<<"manufacturerID: \""<<info.manufacturerID<<'"'<<std::endl
<<"model: \""<<info.model<<'"'<<std::endl
<<"serialNumber: \""<<info.serialNumber<<'"'<<std::endl
<<"serialNumber: \""<<cryptoki::readable(info.serialNumber)
<<'"'<<std::endl
<<"flags: \""<<info.flags<<'"'<<std::endl
<<"maxSessionCount: \""<<info.maxSessionCount<<'"'<<std::endl
<<"sessionCount: \""<<info.sessionCount<<'"'<<std::endl
@@ -56,7 +57,8 @@ int main(int argc, char const*const*const argv) try {
<<'.'<<(int)info.hardwareVersion.minor<<'"'<<std::endl
<<"firmwareVersion: \""<<(int)info.firmwareVersion.major
<<'.'<<(int)info.firmwareVersion.minor<<'"'<<std::endl
<<"utcTime: \""<<info.utcTime<<'"'<<std::endl;
<<"utcTime: \""<<cryptoki::readable(info.utcTime)
<<'"'<<std::endl;
cryptoki::MechanismList mechs(it->mechanismlist());
for (cryptoki::MechanismList::iterator it2(mechs.begin());
it2!=mechs.end(); ++it2) {
@@ -73,15 +75,15 @@ int main(int argc, char const*const*const argv) try {
std::cout<<"Objects Found: "<<objs.size()<<std::endl;
for (cryptoki::ObjectList::iterator it(objs.begin());
it!=objs.end(); ++it) {
cryptoki::AttributeMap attrs(it->getattributevalue());
std::cout<<"-------------------- Object -----------------"<<std::endl;
cryptoki::AttributeMap attrs(it->attributes());
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;
std::cout<<" - attribute: "<<it->second.name()<<"=\""
<<cryptoki::readable(it->second.value)<<'"'<<std::endl;
}
}
std::cout<<"**** Success"<<std::endl;
} catch (std::exception& x) {
std::cerr<<"**** FEHLER in "<<*argv<<": "<<x.what()<<std::endl;
}