#ifndef INCLUDED_BOBCAT_ISYMCRYPTSTREAMBUF_
#define INCLUDED_BOBCAT_ISYMCRYPTSTREAMBUF_

#include <bobcat/fbb>
#include <bobcat/isymcryptbase>

namespace FBB
{
    // generic class name, only 2 specializations exist: ENCRYPT and DECRYPT
    // defined in FBB::CryptType

template <CryptType>
class ISymCryptStreambuf;

template <>
class ISymCryptStreambuf<ENCRYPT>: public IUO::ISymCryptBase
{
    public:
        template <typename StreamSpec>
        ISymCryptStreambuf(                                     // 1.f
            StreamSpec &streamSpec,
            std::string const &cipherName,
            std::string const &key,
            std::string const &iv,
            size_t bufSize = 100
        );

        // inherits static size_t keyLength(char const *cipherName) and
        // size_t ivLength(char const *cipherName)
};

template <>
class ISymCryptStreambuf<DECRYPT>: public IUO::ISymCryptBase
{
    public:
        template <typename StreamSpec>
        ISymCryptStreambuf(                                     // 2.f
            StreamSpec &streamSpec,
            std::string const &cipherName,
            std::string const &key,
            std::string const &iv,
            size_t bufSize = 100
        );
};

#include "isymcryptstreambuf1.f"
#include "isymcryptstreambuf2.f"

}   // namespace FBB

#endif
