FBB::ISymCryptStreambuf(3bobcat) | Symmetric en- and decryption | FBB::ISymCryptStreambuf(3bobcat) |
FBB::ISymCryptStreambuf - Streambuf performing symmetric en/decryption
#include <bobcat/isymcryptstreambuf>
Linking option: -lbobcat -lcrypto
FBB::ISymCryptStreambuf objects can be used as std::streambuf objects of std::istream objected, and encrypt or decrypt information that is made available via separate std::istream streams.
The class ISymCryptStreambuf is a class template, using a FBB::CryptType template non-type parameter. Objects of the class FBB::ISymCryptStreambuf<FBB::ENCRYPT> encrypt the information they receive, objects of the class FBB::ISymCryptStreambuf<FBB::DECRYPT> decrypt the information they receive.
All symmetric encryption methods defined by the OpenSSL library that can be selected by name may be used to en/decrypt information. To select a particular encryption method an identifier is passed to the constructor. E.g., "aes-256-gcm". For an overview of the currently supported cipher algorithms issue the command
openssl list -cipher-algorithms
ISymCryptStreambuf objects read the information to en/decrypt from std::istream objects, which are at construction-time specified as istream references or by filename. The characters that are thereupon extracted or read from ISymCryptStream objects are en/decrypted, and could, e.g., be written to some output stream.
FBB
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace FBB.
FBB::ISymCryptBase (public)
The class FBB::ISymCryptBase is an `internal use only’ class, derived from std::streambuf, and therefore ISymCryptStreambuf is a std::streambuf class.
If the construction fails an exception is thrown, mentioning the openssl function that failed to complete (see also errorMsg below).
The move constructor is available, the copy constructor and assignment operators are not available,
Since the class is publicly derived from std::istreambuf, all std::streambuf members can can be used.
The latter two functions throw exceptions if cipherName does not contain the name of a supported cipher algorithm.
See the example in the isymcryptstream(3bobcat) man-page. Instead of defining an ISymCryptStream an ISymCryptStreamBuf can be defined, passing its address to a std::istream which can then be used as the ISymCryptStream used in the example.
bobcat/isymcryptstream - defines the class interface
bobcat(7), isymcryptstream(3bobcat), osymcryptstream(3bobcat), osymcryptstreambuf(3bobcat)
None Reported.
Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’.
This is free software, distributed under the terms of the GNU General Public License (GPL).
Frank B. Brokken (f.b.brokken@rug.nl).
2005-2022 | libbobcat-dev_6.02.02 |