23 #ifndef _ASTERISK_CRYPTO_H
24 #define _ASTERISK_CRYPTO_H
26 #if defined(__cplusplus) || defined(c_plusplus)
34 #include "openssl/aes.h"
42 #define AST_KEY_PUBLIC (1 << 0)
43 #define AST_KEY_PRIVATE (1 << 1)
144 (
const unsigned char *key, ast_aes_encrypt_key *ctx),
156 (
const unsigned char *key, ast_aes_decrypt_key *ctx),
166 (
const unsigned char *in,
unsigned char *out,
const ast_aes_encrypt_key *ctx),
176 (
const unsigned char *in,
unsigned char *out,
const ast_aes_decrypt_key *ctx),
181 #if defined(__cplusplus) || defined(c_plusplus)
int ast_decrypt_bin(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key)
Decrypt a message using a given private key.
int ast_check_signature_bin(struct ast_key *key, const char *msg, int msglen, const unsigned char *sig)
Check the authenticity of a message signature using a given public key.
int ast_crypto_loaded(void)
Optional API function macros.
int ast_aes_set_encrypt_key(const unsigned char *key, ast_aes_encrypt_key *ctx)
Set an encryption key.
#define AST_OPTIONAL_API(result, name, proto, stub)
Define an optional API function.
void ast_aes_decrypt(const unsigned char *in, unsigned char *out, const ast_aes_decrypt_key *ctx)
AES decrypt data.
AES_KEY ast_aes_encrypt_key
void ast_aes_encrypt(const unsigned char *in, unsigned char *out, const ast_aes_encrypt_key *ctx)
AES encrypt data.
int ast_encrypt_bin(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key)
Encrypt a message using a given private key.
int ast_sign_bin(struct ast_key *key, const char *msg, int msglen, unsigned char *sig)
Sign a message signature using a given private key.
int ast_aes_set_decrypt_key(const unsigned char *key, ast_aes_decrypt_key *ctx)
Set a decryption key.
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
int ast_sign(struct ast_key *key, char *msg, char *sig)
Sign a message signature using a given private key.
AES_KEY ast_aes_decrypt_key
Support for logging to various files, console and syslog Configuration in file logger.conf.
int ast_check_signature(struct ast_key *key, const char *msg, const char *sig)
Check the authenticity of a message signature using a given public key.
struct ast_key * ast_key_get(const char *key, int type)
Retrieve a key.