00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ENCRYPTSTREAM_H
00016 #define ENCRYPTSTREAM_H
00017
00018 #include "dtoolbase.h"
00019
00020
00021 #ifdef HAVE_OPENSSL
00022
00023 #include "encryptStreamBuf.h"
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class EXPCL_DTOOLCONFIG IDecryptStream : public istream {
00038 PUBLISHED:
00039 INLINE IDecryptStream();
00040 INLINE IDecryptStream(istream *source, bool owns_source,
00041 const string &password);
00042
00043 INLINE IDecryptStream &open(istream *source, bool owns_source,
00044 const string &password);
00045 INLINE IDecryptStream &close();
00046
00047 INLINE const string &get_algorithm() const;
00048 INLINE int get_key_length() const;
00049 INLINE int get_iteration_count() const;
00050
00051 private:
00052 EncryptStreamBuf _buf;
00053 };
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 class EXPCL_DTOOLCONFIG OEncryptStream : public ostream {
00067 PUBLISHED:
00068 INLINE OEncryptStream();
00069 INLINE OEncryptStream(ostream *dest, bool owns_dest,
00070 const string &password);
00071
00072 INLINE OEncryptStream &open(ostream *dest, bool owns_dest,
00073 const string &password);
00074 INLINE OEncryptStream &close();
00075
00076 INLINE void set_algorithm(const string &algorithm);
00077 INLINE void set_key_length(int key_length);
00078 INLINE void set_iteration_count(int iteration_count);
00079
00080 private:
00081 EncryptStreamBuf _buf;
00082 };
00083
00084 #include "encryptStream.I"
00085
00086 #endif // HAVE_OPENSSL
00087
00088
00089 #endif
00090
00091