Example #1
0
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();
}
Example #2
0
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;
}