Well here's the problem right here: when you assign a char array to an
std::string using operator=, as you do in "digsignature=buffer;", the
assignment operator treats the char array as a C string, meaning NUL-
terminated; if your signature happened to contain NUL bytes, the
resulting std::string would be truncated. You should use one of the
mechanisms that allows specifying the length of the data instead; for
example, construct digsignature as follows:
std::string digsignature(buffer, size);
Chris
On 2012-07-27, at 5:01, Michele <[email protected]> wrote:
char buffer
[size]; //local
char array, dimensionated with the size of the signature (always 192
bytes)
int i;
for(i = 0; i< size; i++)
{
buffer[i] =
0; //buffer
initialization
}
f2.read(buffer, size);
cout << f2.gcount() << "bytes\n"; //it reads
always:192 bytes
f2.close();
digsignature =
""; //public class
member variable
digsignature = buffer;
--
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at
http://www.cryptopp.com.