CryptoPP::ArraySource
is a typedef
of CryptoPP::StringSource
. The signature of StringSource
's relevant constructor is:
StringSource(const byte *string,
size_t length,
bool pumpAll,
BufferedTransformation *attachment=NULL);
So your third argument which is a pointer to a CryptoPP::Base64Encoder
is being cast to a bool
, and the fourth argument is the default NULL
.
To resolve this, just do:
CryptoPP::ArraySource(buffer, length, true,
new CryptoPP::Base64Encoder(
new CryptoPP::ArraySink(temp_str, lenb64)));