Fawkes API
Fawkes Development Version
encrypt.h
1
2
/***************************************************************************
3
* encrypt.h - Message encryption routine
4
*
5
* Created: Thu May 03 15:01:13 2007
6
* Copyright 2006-2014 Tim Niemueller [www.niemueller.de]
7
****************************************************************************/
8
9
/* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version. A runtime exception applies to
13
* this software (see LICENSE.GPL_WRE file mentioned below for details).
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Library General Public License for more details.
19
*
20
* Read the full text in the LICENSE.GPL_WRE file in the doc directory.
21
*/
22
23
#ifndef _NETCOMM_CRYPTO_ENCRYPT_H_
24
#define _NETCOMM_CRYPTO_ENCRYPT_H_
25
26
#include <core/exception.h>
27
28
#include <cstddef>
29
30
namespace
fawkes
{
31
32
class
MessageEncryptionException :
public
Exception
33
{
34
public
:
35
MessageEncryptionException
(
const
char
*msg);
36
};
37
38
class
MessageEncryptor
39
{
40
public
:
41
MessageEncryptor
(
const
unsigned
char
*key,
const
unsigned
char
*iv);
42
~MessageEncryptor
();
43
44
void
set_plain_buffer
(
void
*buffer,
size_t
buffer_length);
45
void
set_crypt_buffer
(
void
*buffer,
size_t
buffer_length);
46
47
size_t
recommended_crypt_buffer_size
();
48
49
size_t
encrypt
();
50
51
private
:
52
void
* plain_buffer;
53
size_t
plain_buffer_length;
54
void
* crypt_buffer;
55
size_t
crypt_buffer_length;
56
57
const
unsigned
char
*key;
58
const
unsigned
char
*iv;
59
};
60
61
}
// end namespace fawkes
62
63
#endif
fawkes::MessageEncryptor::~MessageEncryptor
~MessageEncryptor()
Empty destructor.
Definition:
encrypt.cpp:99
fawkes::MessageEncryptor::recommended_crypt_buffer_size
size_t recommended_crypt_buffer_size()
Get recommended crypted buffer size.
Definition:
encrypt.cpp:128
fawkes::MessageEncryptor::set_crypt_buffer
void set_crypt_buffer(void *buffer, size_t buffer_length)
Set crypted buffer.
Definition:
encrypt.cpp:151
fawkes::MessageEncryptionException::MessageEncryptionException
MessageEncryptionException(const char *msg)
Constructor.
Definition:
encrypt.cpp:49
fawkes::MessageEncryptor::encrypt
size_t encrypt()
Encrypt.
Definition:
encrypt.cpp:162
fawkes::MessageEncryptor
Definition:
encrypt.h:43
fawkes
fawkes::MessageEncryptor::MessageEncryptor
MessageEncryptor(const unsigned char *key, const unsigned char *iv)
Constructor.
Definition:
encrypt.cpp:87
fawkes::MessageEncryptor::set_plain_buffer
void set_plain_buffer(void *buffer, size_t buffer_length)
Set plain buffer.
Definition:
encrypt.cpp:109
src
libs
netcomm
crypto
encrypt.h
Generated by
1.8.17