23#ifndef _ASTERISK_CRYPTO_H
24#define _ASTERISK_CRYPTO_H
26#if defined(__cplusplus) || defined(c_plusplus)
36#define AST_CRYPTO_RSA_KEY_BITS 1024
37#define AST_CRYPTO_AES_BLOCKSIZE 128
46#define AST_KEY_PUBLIC (1 << 0)
47#define AST_KEY_PRIVATE (1 << 1)
191#if defined(__cplusplus) || defined(c_plusplus)
int ast_crypto_loaded(void)
int ast_aes_set_encrypt_key(const unsigned char *key, ast_aes_encrypt_key *ctx)
Set an encryption key.
struct ast_key * ast_key_get(const char *kname, int ktype)
Retrieve a key.
int ast_check_signature_bin(struct ast_key *key, const char *msg, int msglen, const unsigned char *dsig)
Check the authenticity of a message signature using a given public key.
int ast_aes_set_decrypt_key(const unsigned char *key, ast_aes_decrypt_key *ctx)
Set a decryption key.
int ast_sign_bin(struct ast_key *key, const char *msg, int msglen, unsigned char *dsig)
Sign a message signature using a given private key.
int ast_aes_encrypt(const unsigned char *in, unsigned char *out, const ast_aes_encrypt_key *key)
AES encrypt data.
int ast_aes_decrypt(const unsigned char *in, unsigned char *out, const ast_aes_decrypt_key *key)
AES decrypt data.
#define AST_CRYPTO_AES_BLOCKSIZE
int ast_sign(struct ast_key *key, char *msg, char *sig)
Sign a message signature using a given private key.
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.
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_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_crypto_reload(void)
Support for logging to various files, console and syslog Configuration in file logger....
Optional API function macros.
#define AST_OPTIONAL_API(result, name, proto, stub)
Declare an optional API function.
unsigned char raw[AST_CRYPTO_AES_BLOCKSIZE/8]