#ifndef INCLUDED_BOBCAT_ISYMCRYPTSTREAM_
#define INCLUDED_BOBCAT_ISYMCRYPTSTREAM_

#include <bobcat/isymcryptstreambuf>

namespace FBB
{

template <CryptType cryptType>
struct ISymCryptStream: private ISymCryptStreambuf<cryptType>,
                        public std::istream
{
    template <typename StreamSpec>
    ISymCryptStream(                                            // 1.f
        StreamSpec &streamSpec,
        std::string const &cipherName,
        std::string const &key,
        std::string const &iv,
        size_t inBufSize = 100
    );

    using ISymCryptStreambuf<cryptType>::keyLength;
    using ISymCryptStreambuf<cryptType>::ivLength;
};

template <CryptType cryptType>
template <typename StreamSpec>
ISymCryptStream<cryptType>::ISymCryptStream(
    StreamSpec &streamSpec,
    std::string const &cipherName,
    std::string const &key,
    std::string const &iv,
    size_t inBufSize
)
:
    ISymCryptStreambuf<cryptType>(
        streamSpec,
        cipherName,
        key,
        iv,
        inBufSize
    ),
    std::istream(this)
{}

}   // namespace FBB

#endif
