17 #ifndef RSAENCODERDECODER_HPP_
18 #define RSAENCODERDECODER_HPP_
22 #include <botan/rsa.h>
23 #include <boost/scoped_ptr.hpp>
24 #include <boost/cstdint.hpp>
31 const std::string& privKey,
32 const Botan::MemoryVector<boost::uint8_t>& remoteKey);
36 std::string
encodeData(
const boost::uint8_t *data,
size_t size);
37 std::string
decodeData(
const boost::uint8_t *data,
size_t size);
38 Botan::SecureVector<boost::uint8_t>
signData(
const boost::uint8_t *data,
size_t size);
39 bool verifySignature(
const boost::uint8_t *data,
size_t len,
const boost::uint8_t *sig,
size_t sigLen);
42 std::string cipherPipe(
const boost::uint8_t *data,
size_t size, Botan::Cipher_Dir dir);
45 Botan::AutoSeeded_RNG rng_;
46 boost::scoped_ptr<Botan::X509_PublicKey> pubKey_;
47 boost::scoped_ptr<Botan::PKCS8_PrivateKey> privKey_;
48 boost::scoped_ptr<Botan::X509_PublicKey> remoteKey_;
50 Botan::SymmetricKey sessionKey_;
RsaEncoderDecoder(const Botan::MemoryVector< boost::uint8_t > &pubKey, const std::string &privKey, const Botan::MemoryVector< boost::uint8_t > &remoteKey)
std::string decodeData(const boost::uint8_t *data, size_t size)
Botan::SecureVector< boost::uint8_t > getEncodedSessionKey()
bool verifySignature(const boost::uint8_t *data, size_t len, const boost::uint8_t *sig, size_t sigLen)
Botan::SecureVector< boost::uint8_t > signData(const boost::uint8_t *data, size_t size)
std::string encodeData(const boost::uint8_t *data, size_t size)