14 #ifndef ENCRYPTSTREAMBUF_H 15 #define ENCRYPTSTREAMBUF_H 22 typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
27 class EXPCL_DTOOL_PRC EncryptStreamBuf :
public std::streambuf {
30 virtual ~EncryptStreamBuf();
32 void open_read(std::istream *source,
bool owns_source,
const std::string &password);
35 void open_write(std::ostream *dest,
bool owns_dest,
const std::string &password);
38 INLINE
void set_algorithm(
const std::string &algorithm);
39 INLINE
const std::string &get_algorithm()
const;
41 INLINE
void set_key_length(
int key_length);
42 INLINE
int get_key_length()
const;
44 INLINE
void set_iteration_count(
int iteration_count);
45 INLINE
int get_iteration_count()
const;
48 virtual int overflow(
int c);
50 virtual int underflow();
53 size_t read_chars(
char *start,
size_t length);
54 void write_chars(
const char *start,
size_t length);
57 std::istream *_source;
63 std::string _algorithm;
67 EVP_CIPHER_CTX *_read_ctx;
68 size_t _read_block_size;
69 unsigned char *_read_overflow_buffer;
70 size_t _in_read_overflow_buffer;
72 EVP_CIPHER_CTX *_write_ctx;
73 size_t _write_block_size;
78 #endif // HAVE_OPENSSL
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.