Is it possible to convert string <--> SecByteBlock
Yes. Each has a constructor that takes a pointer and a length.
string s1("hello world");
SecByteBlock b1((const byte*)s1.data(), s1.size());
And
byte a[] = {'h','e','l','l','o',' ','w','o','r','l','d'};
SecByteBlock b2(a, sizeof(a));
string s2((const char*)b2.data(), b2.size());
And in your case, the StringSource
also has a constructor that takes a pointer and a length. So you could perform:
byte a[] = {'h','e','l','l','o',' ','w','o','r','l','d'};
SecByteBlock b3(a, sizeof(a));
StringSource ss1(b3.data(), b3.size(), true ...);
Or even more directly:
byte a[] = {'h','e','l','l','o',' ','w','o','r','l','d'};
StringSource ss1(a, sizeof(a), true ...);