new method Init.reset() - try whether we can find newly added slots

master
Marc Wäckerlin 15 years ago
parent 7e38f050f7
commit f2b8078cb1
  1. 8
      install-64-and-32-bit-linux.sh
  2. 8
      src/cryptoki.cxx
  3. 8
      src/cryptoki.hxx

@ -1,5 +1,8 @@
./bootstrap.sh && \ ./bootstrap.sh && \
LDFLAGS="-L/usr/lib32 -m32" CXXFLAGS="-m32" ./configure \ LDFLAGS="-L/usr/lib32 -m32" \
CXXFLAGS="-m32" \
CPPFLAGS="-DCRYPTOKI_LOG\(X\)='std::clog<<X<<"'"@"'"<<__PRETTY_FUNCTION__<<std::endl'" \
./configure \
--libdir=/usr/local/lib32 \ --libdir=/usr/local/lib32 \
--build=x86_64 \ --build=x86_64 \
--host=i386 && \ --host=i386 && \
@ -9,7 +12,7 @@ make clean && \
LDFLAGS="-L/opt/local/i586-mingw32msvc/lib" \ LDFLAGS="-L/opt/local/i586-mingw32msvc/lib" \
CPPFLAGS="-I/opt/local/i586-mingw32msvc/include" \ CPPFLAGS="-I/opt/local/i586-mingw32msvc/include" \
./configure \ ./configure \
--prefix=/opt/local/i586-mingw32msvc \ --prefix=/opt/local/ig586-mingw32msvc \
--build=x86_64 \ --build=x86_64 \
--host=i586-mingw32msvc && \ --host=i586-mingw32msvc && \
make && \ make && \
@ -18,4 +21,3 @@ make clean && \
./configure && \ ./configure && \
make check && \ make check && \
sudo make install sudo make install

@ -292,6 +292,7 @@ namespace cryptoki {
attrs.push_back(Attribute(CKA_ISSUER, cert.issuerDER())); attrs.push_back(Attribute(CKA_ISSUER, cert.issuerDER()));
attrs.push_back(Attribute(CKA_SERIAL_NUMBER, cert.serial())); attrs.push_back(Attribute(CKA_SERIAL_NUMBER, cert.serial()));
attrs.push_back(Attribute(CKA_VALUE, cert.valueDER())); attrs.push_back(Attribute(CKA_VALUE, cert.valueDER()));
CRYPTOKI_LOG("create: serial = "<<crypto::hex(cert.serial()));
return create(attrs); return create(attrs);
} }
@ -337,13 +338,6 @@ namespace cryptoki {
return create(attrs); return create(attrs);
} }
Object Session::create(const std::string& label,
const openssl::PKCS12& p12) {
CRYPTOKI_LOG("log");
AttributeList attrs;
return create(attrs);
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
Object Session::create(const AttributeList& attrs) { Object Session::create(const AttributeList& attrs) {
CRYPTOKI_LOG("log"); CRYPTOKI_LOG("log");

@ -776,6 +776,12 @@ namespace cryptoki {
} }
} }
Init& reset() {
check(_fn->C_Finalize(0), CRYPTOKI_FN_LOG("C_Finalize"));
check(_fn->C_Initialize(0), CRYPTOKI_FN_LOG("C_Initialize"));
return *this;
}
/*! @name C Like Error Handling /*! @name C Like Error Handling
You are strongly recommended not to disable exception You are strongly recommended not to disable exception
@ -1083,8 +1089,6 @@ namespace cryptoki {
//! Create a new PrivateKey Object. //! Create a new PrivateKey Object.
Object create(const std::string& label, const openssl::PrivateKey& key, Object create(const std::string& label, const openssl::PrivateKey& key,
const openssl::X509& cert); const openssl::X509& cert);
//! Create a new Certificate and optional PrivateKey Object.
Object create(const std::string& label, const openssl::PKCS12& p12);
//@} //@}

Loading…
Cancel
Save