#ifndef INCLUDED_BOBCAT_OSYMCRYPTSTREAM_
#define INCLUDED_BOBCAT_OSYMCRYPTSTREAM_

#include <bobcat/osymcryptstreambuf>

namespace FBB
{

template <CryptType cryptType>
struct OSymCryptStream: private OSymCryptStreambuf<cryptType>,
                        public std::ostream
{
    template <typename StreamSpec>
    OSymCryptStream(                                            // 1.f
        StreamSpec &streamSpec,
        std::string const &cipherName,
        std::string const &key,
        std::string const &iv,
        size_t inBufSize = 100
    );
    using OSymCryptStreambuf<cryptType>::keyLength;
    using OSymCryptStreambuf<cryptType>::ivLength;
};

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

}   // namespace FBB

#endif
