예제 #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();
}
예제 #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;
}