8 #ifndef BOTAN_INTERNAL_OPENSSL_H_
9 #define BOTAN_INTERNAL_OPENSSL_H_
11 #include <botan/pk_ops_fwd.h>
12 #include <botan/secmem.h>
13 #include <botan/exceptn.h>
17 #include <openssl/err.h>
18 #include <openssl/evp.h>
20 #if defined(BOTAN_HAS_RC4)
21 #include <openssl/rc4.h>
30 class RandomNumberGenerator;
37 Exception(what +
" failed: " + ERR_error_string(err, nullptr)),
42 int error_code() const noexcept
override {
return m_err; }
50 std::unique_ptr<BlockCipher>
60 std::unique_ptr<HashFunction>
65 #if defined(BOTAN_HAS_RSA)
70 std::unique_ptr<PK_Ops::Encryption>
71 make_openssl_rsa_enc_op(
const RSA_PublicKey& key,
const std::string& params);
72 std::unique_ptr<PK_Ops::Decryption>
73 make_openssl_rsa_dec_op(
const RSA_PrivateKey& key,
const std::string& params);
75 std::unique_ptr<PK_Ops::Verification>
76 make_openssl_rsa_ver_op(
const RSA_PublicKey& key,
const std::string& params);
77 std::unique_ptr<PK_Ops::Signature>
78 make_openssl_rsa_sig_op(
const RSA_PrivateKey& key,
const std::string& params);
79 std::unique_ptr<RSA_PrivateKey>
80 make_openssl_rsa_private_key(RandomNumberGenerator& rng,
size_t rsa_bits);
86 #if defined(BOTAN_HAS_ECDSA)
88 class ECDSA_PublicKey;
89 class ECDSA_PrivateKey;
91 std::unique_ptr<PK_Ops::Verification>
92 make_openssl_ecdsa_ver_op(
const ECDSA_PublicKey& key,
const std::string& params);
93 std::unique_ptr<PK_Ops::Signature>
94 make_openssl_ecdsa_sig_op(
const ECDSA_PrivateKey& key,
const std::string& params);
100 #if defined(BOTAN_HAS_ECDH)
102 class ECDH_PrivateKey;
104 std::unique_ptr<PK_Ops::Key_Agreement>
105 make_openssl_ecdh_ka_op(
const ECDH_PrivateKey& key,
const std::string& params);
109 #if defined(BOTAN_HAS_RC4)
111 std::unique_ptr<StreamCipher>
112 make_openssl_rc4(
size_t skip);
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
ErrorType error_type() const noexceptoverride
Cipher_Mode * make_openssl_cipher_mode(const std::string &name, Cipher_Dir direction)
std::unique_ptr< HashFunction > make_openssl_hash(const std::string &name)
int error_code() const noexceptoverride
std::unique_ptr< BlockCipher > make_openssl_block_cipher(const std::string &name)
OpenSSL_Error(const std::string &what, int err)