[Botan-devel] Converting SecureVector<byte> to string

Jack Lloyd lloyd at randombit.net
Fri Mar 27 20:50:32 EDT 2009


On Fri, Mar 27, 2009 at 05:33:39PM -0400, Z. S. O. wrote:
> My current method of converting a SecureVector<byte> to a string is put it
> in a pipe with the Base64_Encoder filter. To go the other direction, I pipe
> it with Base64_Decoder. I've decided, however, that I don't want to encode
> it in any readable format; I'd like the raw binary data. Is there a simple
> way to do this?

All you should need for this is

std::string s(reinterpret_cast<const char*>(memvec.begin()),
              memvec.size());

-Jack



More information about the botan-devel mailing list