ReadBinaryFile and WriteBinaryFile current work with std::string
. This PR adds support for std::vector<unsigned char>>
.
It also uses AutoFile
now.
This is [update: probably not] used in #28983 to store the static key for the Template Provider, in a manner very similar to how we store the Tor v3 and i2p key. However it made no sense to me to store a CKey
as plain text. See commit “Persist static key for Template Provider” for how it’s used.
It uses a template and leverages the fact that both std::string
and std::vector<unsigned char>>
have an insert()
method that can take a char array.
The unsigned char
support is not used in this PR, but tests do cover it.