libbrillo: Blob to/from std::string conversions

Add routines that allow dumping Blob contents into an
std::string, and, vice versa, constructing Blob from
such a string.

These helpers should simplify writing code that works
with Blob's, and consequently help transitioning away from
SecureBlob (as the latter provides the same capabilities).

TEST=new unit test (BlobTest.StringConversions)

Change-Id: I18223a99899216fe07cbf948bef86dce86777f69
Commit-Ready: Maksim Ivanov <>
Tested-by: Maksim Ivanov <>
Reviewed-by: Jorge Lucangeli Obes <>
3 files changed