auxiliaries are now in cryptaux.hxx; some get methods for openssl::X509

This commit is contained in:
Marc Wäckerlin
2009-09-21 07:43:32 +00:00
parent 5c60773269
commit d3793f30a2
7 changed files with 151 additions and 69 deletions

View File

@@ -10,6 +10,8 @@
#ifndef PCSC_HXX
#define PCSC_HXX
#include <cryptaux.hxx>
#include <string>
#ifdef WIN32
@@ -68,25 +70,11 @@
best fits the common needs. */
//@{
/*! @defgroup pcsclib PCSC C++ Library */
/*! @defgroup pcsctypes PCSC Types and Auxiliary */
/*! @defgroup pcscexceptions PCSC Exceptions */
//! @see gpcsc
namespace pcsc {
//! @addtogroup pcsctypes
//@{
std::string hex(const std::string& data) {
std::stringstream res;
for (std::string::const_iterator it(data.begin()); it!=data.end(); ++it)
res<<std::hex<<std::setfill('0')<<std::setw(2)
<<(unsigned int)(unsigned char)*it;
return res.str();
}
//@}
//============================================================================
//! @addtogroup pcsclib
//@{
@@ -236,7 +224,7 @@ namespace pcsc {
check(SCardTransmit(_id, &rPci,
(unsigned char*)in.c_str(), in.size(),
0, buff, &len),
"smartcard transmit message "+hex(in));
"smartcard transmit message "+crypto::hex(in));
return std::string((char*)buff, len);
}
@@ -312,7 +300,7 @@ namespace pcsc {
check(SCardConnect(_connection._id, strconv(name).c_str(),
mode, protocol,
&_id, &_protocol),
"connect smartcard \""+name+"\" ("+hex(name)+")");
"connect smartcard \""+name+"\" ("+crypto::hex(name)+")");
}
//! forbidden