We can read objects :-)

master
Marc Wäckerlin 15 years ago
parent 3664f2344a
commit 1e903b58e4
  1. 4
      doc/examples/cryptoki-demo.cxx
  2. 2
      doc/examples/makefile.am
  3. 3
      src/cryptoki.hxx

@ -68,6 +68,10 @@ int main(int argc, char const*const*const argv) try {
<<"maxKeySize: \""<<mechinfo.maxKeySize<<'"'<<std::endl <<"maxKeySize: \""<<mechinfo.maxKeySize<<'"'<<std::endl
<<"flags: \""<<mechinfo.flags<<'"'<<std::endl; <<"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;
} catch (std::exception& x) { } catch (std::exception& x) {
std::cerr<<"**** FEHLER in "<<*argv<<": "<<x.what()<<std::endl; std::cerr<<"**** FEHLER in "<<*argv<<": "<<x.what()<<std::endl;
} }

@ -12,7 +12,7 @@ pcsc_demo_SOURCES = pcsc-demo.cxx
pcsc_demo_LDADD = -lpcsclite pcsc_demo_LDADD = -lpcsclite
cryptoki_demo_SOURCES = cryptoki-demo.cxx cryptoki_demo_SOURCES = cryptoki-demo.cxx
cryptoki_demo_LDADD = -ldl -lcryptoki++ cryptoki_demo_LDADD = -ldl -lpthread -lcryptoki++
cryptoki_demo_LDFLAGS = -L${top_builddir}/src cryptoki_demo_LDFLAGS = -L${top_builddir}/src
MAINTAINERCLEANFILES = makefile.in MAINTAINERCLEANFILES = makefile.in

@ -668,7 +668,8 @@ namespace cryptoki {
/*! @param slot slot to open a session on */ /*! @param slot slot to open a session on */
Session(Slot& slot): _slot(slot), _session(0), _res(CKR_OK) { Session(Slot& slot): _slot(slot), _session(0), _res(CKR_OK) {
//! calls @c C_OpenSession //! calls @c C_OpenSession
check(_slot._init->_fn->C_OpenSession(_slot._slot, 0, 0, 0, &_session), check(_slot._init->_fn->C_OpenSession
(_slot._slot, CKF_SERIAL_SESSION, 0, 0, &_session),
CRYPTOKI_FN_LOG("C_OpenSession")); CRYPTOKI_FN_LOG("C_OpenSession"));
//! @todo pass parameter //! @todo pass parameter
} }

Loading…
Cancel
Save