I seem to be having intelligence issues today - have I missed something
here? In filters.h (in Crypto++ 5.2.1) StringSource has the following
public interfaces/constructors available:

<snip>
//! string-based implementation of Source interface
class CRYPTOPP_DLL StringSource : public SourceTemplate<StringStore>
{
public:
   StringSource(BufferedTransformation *attachment = NULL)
      : SourceTemplate<StringStore>(attachment) {}
   StringSource(const char *string, bool pumpAll, BufferedTransformation
*attachment = NULL)
      : SourceTemplate<StringStore>(attachment) {SourceInitialize
(pumpAll, MakeParameters("InputBuffer", ConstByteArrayParameter
(string)));}
   StringSource(const byte *string, unsigned int length, bool pumpAll,
BufferedTransformation *attachment = NULL)
      : SourceTemplate<StringStore>(attachment) {SourceInitialize
(pumpAll, MakeParameters("InputBuffer", ConstByteArrayParameter(string,
length)));}
   StringSource(const std::string &string, bool pumpAll,
BufferedTransformation *attachment = NULL)
      : SourceTemplate<StringStore>(attachment) {SourceInitialize
(pumpAll, MakeParameters("InputBuffer", ConstByteArrayParameter
(string)));}
};
</snip>

I am trying to use the third (const byte* etc...):

std::string data;
StringSource (key.data (), key.size (), true,
              new HexEncoder (new StringSink (data)));


key is of type SecByteBlock. However, when compiling (GCC 3.4.2 on
Linux) I get this error:

no match for call to `(CryptoPP::StringSource) (byte*, size_t, bool,
CryptoPP::BufferedTransformation*)'

Isn't that what I'm passing the StringSource constructor!? I've tried
the obvious (changing byte* to const and size_t to uint - no
difference).

Or does anyone have a better method of encoding a SecByteBlock
class/content?

Regards

Jim

-- 
James Vanns BSc (Hons) MCP
Linux Systems Administrator
Software Engineer (Linux / C & C++)
Canterbury Christ Church University College
Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x24045370


Reply via email to