Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

crypto.h File Reference

#include <asterisk/channel.h>
#include <asterisk/file.h>

Include dependency graph for crypto.h:

Include dependency graph

Go to the source code of this file.

Defines

#define AST_KEY_PUBLIC   (1 << 0)
#define AST_KEY_PRIVATE   (1 << 1)

Functions

ast_key * ast_key_get (char *key, int type)
 Retrieve a key.

int ast_key_init (int fd)
 Initialize keys (that is, retrieve pass codes for all private keys).

int ast_check_signature (struct ast_key *key, char *msg, char *sig)
 Check the authenticity of a message signature using a given public key.

int ast_sign (struct ast_key *key, char *msg, char *sig)


Define Documentation

#define AST_KEY_PRIVATE   (1 << 1)
 

Definition at line 25 of file crypto.h.

#define AST_KEY_PUBLIC   (1 << 0)
 

Definition at line 24 of file crypto.h.


Function Documentation

int ast_check_signature struct ast_key *  key,
char *  msg,
char *  sig
 

Check the authenticity of a message signature using a given public key.

Parameters:
key a public key to use to verify
msg the message that has been signed
sig the proposed valid signature in mime64-like encoding
Returns 0 if the signature is valid, or -1 otherwise

struct ast_key* ast_key_get char *  key,
int  type
 

Retrieve a key.

Parameters:
name of the key we are retrieving
int type of key (AST_KEY_PUBLIC or AST_KEY_PRIVATE)
Returns the key on success or NULL on failure

int ast_key_init int  fd  ) 
 

Initialize keys (that is, retrieve pass codes for all private keys).

Parameters:
fd a file descriptor for I/O for passwords

int ast_sign struct ast_key *  key,
char *  msg,
char *  sig
 

Parameters:
key a private key to use to create the signature
msg the message to sign
sig a pointer to a buffer of at least 256 bytes in which the mime64-like encoded signature will be stored
Returns 0 on success or -1 on failure.


Generated on Sat Jun 12 16:41:12 2004 for Asterisk by doxygen 1.3.7