# Poco::Crypto

# class CryptoStreamBuf

Library: Crypto
Package: Cipher
Header: Poco/Crypto/CryptoStream.h

## Description

This stream buffer performs cryptographic transformation on the data going through it.

## Inheritance

Direct Base Classes: Poco::BufferedStreamBuf

All Base Classes: Poco::BufferedStreamBuf

## Member Summary

Member Functions: close, readFromDevice, writeToDevice

## Constructors

### CryptoStreamBuf

CryptoStreamBuf(
std::istream & istr,
CryptoTransform::Ptr pTransform,
std::streamsize bufferSize = 8192
);

### CryptoStreamBuf

CryptoStreamBuf(
std::ostream & ostr,
CryptoTransform::Ptr pTransform,
std::streamsize bufferSize = 8192
);

## Destructor

### ~CryptoStreamBuf

virtual ~CryptoStreamBuf();

## Member Functions

### close

void close();

Flushes all buffers and finishes the encryption.

### readFromDevice

int readFromDevice(
char * buffer,
std::streamsize length
);

### writeToDevice

int writeToDevice(
const char * buffer,
std::streamsize length
);