Typedefs | Enumerations | Functions
Top level functions

Function that allow ciphering content. More...

Typedefs

typedef enum _Emile_Cipher_Backend Emile_Cipher_Backend
 Flags describing the implemented backend. More...
 
typedef enum _Emile_Cipher_Algorithm Emile_Cipher_Algorithm
 Flags describing known cipher algorithm. More...
 

Enumerations

enum  _Emile_Cipher_Backend {
  EMILE_NONE,
  EMILE_OPENSSL,
  EMILE_GNUTLS
}
 
enum  _Emile_Cipher_Algorithm { EMILE_AES256_CBC }
 

Functions

Eina_Bool emile_cipher_init (void)
 Force the initialization of the underlying cipher library. More...
 
Emile_Cipher_Backend emile_cipher_module_get (void)
 Get the name of the current used backend. More...
 
Eina_Binbufemile_binbuf_cipher (Emile_Cipher_Algorithm algo, const Eina_Binbuf *in, const char *key, unsigned int length)
 Cipher a buffer with a defined algorithm and key. More...
 
Eina_Binbufemile_binbuf_decipher (Emile_Cipher_Algorithm algo, const Eina_Binbuf *in, const char *key, unsigned int length)
 Decipher a buffer with a defined algorithm and key. More...
 

Detailed Description

Function that allow ciphering content.

Typedef Documentation

Flags describing the implemented backend.

Since
1.14

Flags describing known cipher algorithm.

Since
1.14

Function Documentation

Eina_Bool emile_cipher_init ( void  )

Force the initialization of the underlying cipher library.

This call force the initialisation of GNUTLS or OpenSSL, so that you get the same setup for everyone.

Returns
EINA_TRUE on success, EINA_FALSE otherwise.
See also
emile_cipher_module_get
Since
1.14

References EINA_FALSE, and EINA_TRUE.

Referenced by eet_identity_certificate_print(), eet_identity_close(), eet_identity_open(), eet_identity_print(), emile_binbuf_cipher(), and emile_binbuf_decipher().

Emile_Cipher_Backend emile_cipher_module_get ( void  )

Get the name of the current used backend.

Returns
the name of the current cipher backend.
Since
1.14
Eina_Binbuf* emile_binbuf_cipher ( Emile_Cipher_Algorithm  algo,
const Eina_Binbuf in,
const char *  key,
unsigned int  length 
)

Cipher a buffer with a defined algorithm and key.

Parameters
algoThe algorithm to use to cipher the buffer.
inThe buffer to cipher.
keyThe symetric key to use for ciphering.
lengthThe length of the symetric key to be used.
Returns
the ciphered buffer or NULL on error.
Since
1.14

References eina_binbuf_append_buffer(), eina_binbuf_append_length(), eina_binbuf_free(), eina_binbuf_length_get(), eina_binbuf_new(), eina_binbuf_remove(), eina_binbuf_string_get(), and emile_cipher_init().

Referenced by eet_write_cipher().

Eina_Binbuf* emile_binbuf_decipher ( Emile_Cipher_Algorithm  algo,
const Eina_Binbuf in,
const char *  key,
unsigned int  length 
)

Decipher a buffer with a defined algorithm and key.

Parameters
algoThe algorithm to use to decipher the buffer.
inThe ciphered buffer to decipher.
keyThe symetric key used to cipher the buffer.
lengthThe length of the symetric key used to cipher the buffer.
Returns
the clear buffer or NULL on error.
Note
This won't detect if the given key is the correct one or not. You have to check that the returned data make sense. You should also not treat them as safe.
Since
1.14

References eina_binbuf_append_length(), eina_binbuf_free(), eina_binbuf_length_get(), eina_binbuf_new(), eina_binbuf_remove(), eina_binbuf_string_get(), and emile_cipher_init().

Referenced by eet_read_cipher().