Panda3D
Public Types | Public Member Functions

OEncryptStream Class Reference

An input stream object that uses OpenSSL to encrypt data to another destination stream on-the-fly. More...

Inheritance diagram for OEncryptStream:
ostream ios ios_base

List of all members.

Public Types

enum  openmode
enum  seekdir { beg = 0, cur = 1, end = 2 }

Public Member Functions

 OEncryptStream ()
 OEncryptStream (ostream dest, bool owns_dest, string password)
bool bad ()
 clear ()
OEncryptStream close ()
 Resets the EncryptStream to empty, but does not actually close the dest ostream unless owns_dest was true.
bool eof ()
bool fail ()
 flush ()
bool good ()
OEncryptStream open (ostream dest, bool owns_dest, string password)
 put (char c)
 seekp (long int off, seekdir dir)
 seekp (unsigned long int pos)
 setAlgorithm (string algorithm)
 Specifies the encryption algorithm that should be used for future calls to open().
 setIterationCount (int iteration_count)
 Specifies the number of times to repeatedly hash the key before writing it to the stream in future calls to open().
 setKeyLength (int key_length)
 Specifies the length of the key, in bits, that should be used to encrypt the stream in future calls to open().
unsigned long int tellp ()

Detailed Description

An input stream object that uses OpenSSL to encrypt data to another destination stream on-the-fly.

Attach an OEncryptStream to an existing ostream that will accept encrypted data, and write your unencrypted source data to the OEncryptStream.

Seeking is not supported.


Member Enumeration Documentation

enum openmode [inherited]
enum seekdir [inherited]
Enumerator:
beg 
cur 
end 

Constructor & Destructor Documentation

OEncryptStream ( ostream  dest,
bool  owns_dest,
string  password 
)

Member Function Documentation

bool bad ( ) [inherited]
clear ( ) [inherited]
OEncryptStream close ( )

Resets the EncryptStream to empty, but does not actually close the dest ostream unless owns_dest was true.

bool eof ( ) [inherited]
bool fail ( ) [inherited]
flush ( ) [inherited]
bool good ( ) [inherited]
OEncryptStream open ( ostream  dest,
bool  owns_dest,
string  password 
)
put ( char  c) [inherited]
seekp ( long int  off,
seekdir  dir 
) [inherited]
seekp ( unsigned long int  pos) [inherited]
setAlgorithm ( string  algorithm)

Specifies the encryption algorithm that should be used for future calls to open().

The default is whatever is specified by the encryption-algorithm config variable. The complete set of available algorithms is defined by the current version of OpenSSL.

If an invalid algorithm is specified, there is no immediate error return code, but open() will fail.

setIterationCount ( int  iteration_count)

Specifies the number of times to repeatedly hash the key before writing it to the stream in future calls to open().

Its purpose is to make it computationally more expensive for an attacker to search the key space exhaustively. This should be a multiple of 1,000 and should not exceed about 65 million; the value 0 indicates just one application of the hashing algorithm.

The default is whatever is specified by the encryption-iteration-count config variable.

setKeyLength ( int  key_length)

Specifies the length of the key, in bits, that should be used to encrypt the stream in future calls to open().

The default is whatever is specified by the encryption-key-length config variable.

If an invalid key_length for the chosen algorithm is specified, there is no immediate error return code, but open() will fail.

unsigned long int tellp ( ) [inherited]
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties