void SaveKey(const std::string& filename, const Key& key) { CryptoPP::ByteQueue queue; key.Save(queue); CryptoPP::FileSink file(filename.c_str()); queue.CopyTo(file); file.MessageEnd(); }
inline std::string RSAKeyToString(const typename isRSAKey<T>::type& key) { CryptoPP::ByteQueue queue; key.Save(queue); std::string result; CryptoPP::StringSink sink(result); queue.CopyTo(sink); return result; }