Fawkes API  Fawkes Development Version
fawkes::MessageDecryptor Class Reference

Message decryptor. More...

#include <>>

Public Member Functions

 MessageDecryptor (const unsigned char *key, const unsigned char *iv)
 Constructor. More...
 
 ~MessageDecryptor ()
 Empty destructor. More...
 
void set_plain_buffer (void *buffer, size_t buffer_length)
 Set plain buffer. More...
 
void set_crypt_buffer (void *buffer, size_t buffer_length)
 Set crypted buffer. More...
 
size_t decrypt ()
 Decrypt. More...
 

Detailed Description

Message decryptor.

This class is used to decrypt world info message after they have been received.

This is the opposite part of MessageEncryptor.

This implementation uses OpenSSL for the AES encryption (in fact it uses the accompanying libcrypto that comes with OpenSSL, not libopenssl itself). It is almost everywhere available and easy to use.

See also
MessageEncryptor
Author
Tim Niemueller

Definition at line 38 of file decrypt.h.

Constructor & Destructor Documentation

◆ MessageDecryptor()

fawkes::MessageDecryptor::MessageDecryptor ( const unsigned char *  key,
const unsigned char *  iv 
)

Constructor.

Parameters
keyencryption key
ivinitialisation vector

Definition at line 70 of file decrypt.cpp.

◆ ~MessageDecryptor()

fawkes::MessageDecryptor::~MessageDecryptor ( )

Empty destructor.

Definition at line 83 of file decrypt.cpp.

Member Function Documentation

◆ decrypt()

size_t fawkes::MessageDecryptor::decrypt ( )

Decrypt.

Do the decryption.

Returns
size of the plain text message.

Definition at line 119 of file decrypt.cpp.

References fawkes::Exception::Exception(), and fawkes::MessageDecryptionException::MessageDecryptionException().

◆ set_crypt_buffer()

void fawkes::MessageDecryptor::set_crypt_buffer ( void *  buffer,
size_t  buffer_length 
)

Set crypted buffer.

This is the source buffer which is decrypted.

Parameters
buffercrypted text buffer
buffer_lengthcrypted text buffer length

Definition at line 107 of file decrypt.cpp.

◆ set_plain_buffer()

void fawkes::MessageDecryptor::set_plain_buffer ( void *  buffer,
size_t  buffer_length 
)

Set plain buffer.

This is the destination buffer to which the decrypted plain text is written.

Parameters
bufferplain text buffer
buffer_lengthplain text buffer length

Definition at line 94 of file decrypt.cpp.


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