# AP4_EncryptingStream Class Reference

`#include <Ap4Protection.h>`

Inheritance diagram for AP4_EncryptingStream:

List of all members.

## Public Types
enum | CipherMode { CIPHER_MODE_CTR, CIPHER_MODE_CBC }
## Public Member Functions
virtual AP4_Result | ReadPartial (void *buffer, AP4_Size bytes_to_read, AP4_Size &bytes_read)
virtual AP4_Result | WritePartial (const void *buffer, AP4_Size bytes_to_write, AP4_Size &bytes_written)
virtual AP4_Result | Seek (AP4_Position position)
virtual AP4_Result | Tell (AP4_Position &position)
virtual AP4_Result | GetSize (AP4_LargeSize &size)
virtual void | AddReference ()
virtual void | Release ()
## Static Public Member Functions
static AP4_Result | Create (CipherMode mode, AP4_ByteStream &cleartext_stream, const AP4_UI08 *iv, AP4_Size iv_size, const AP4_UI08 *key, AP4_Size key_size, bool prepend_iv, AP4_BlockCipherFactory *block_cipher_factory, AP4_ByteStream *&stream)

## Detailed Description

Definition at line 363 of file Ap4Protection.h.

## Member Enumeration Documentation

enum AP4_EncryptingStream::CipherMode

Enumerator:

  CIPHER_MODE_CTR |
  CIPHER_MODE_CBC |

Definition at line 365 of file Ap4Protection.h.

## Member Function Documentation

static AP4_Result AP4_EncryptingStream::Create | ( | CipherMode | mode,
|  | AP4_ByteStream & | cleartext_stream,
|  | const AP4_UI08 * | iv,
|  | AP4_Size | iv_size,
|  | const AP4_UI08 * | key,
|  | AP4_Size | key_size,
|  | bool | prepend_iv,
|  | AP4_BlockCipherFactory * | block_cipher_factory,
|  | AP4_ByteStream *& | stream |
| ) |  |  | `[static]`

virtual AP4_Result AP4_EncryptingStream::ReadPartial | ( | void * | buffer,
|  | AP4_Size | bytes_to_read,
|  | AP4_Size & | bytes_read |
| ) |  |  | `[virtual]`

Implements AP4_ByteStream.

virtual AP4_Result AP4_EncryptingStream::WritePartial | ( | const void * | buffer,
|  | AP4_Size | bytes_to_write,
|  | AP4_Size & | bytes_written |
| ) |  |  | `[virtual]`

Implements AP4_ByteStream.

virtual AP4_Result AP4_EncryptingStream::Seek | ( | AP4_Position | position | ) | `[virtual]`

Implements AP4_ByteStream.

virtual AP4_Result AP4_EncryptingStream::Tell | ( | AP4_Position & | position | ) | `[virtual]`

Implements AP4_ByteStream.

virtual AP4_Result AP4_EncryptingStream::GetSize | ( | AP4_LargeSize & | size | ) | `[virtual]`

Implements AP4_ByteStream.

virtual void AP4_EncryptingStream::AddReference | ( |  | ) | `[virtual]`

Implements AP4_Referenceable.

virtual void AP4_EncryptingStream::Release | ( |  | ) | `[virtual]`

Implements AP4_Referenceable.

The documentation for this class was generated from the following file:

- Ap4Protection.h