/* -*- Mode: C; c-file-style: "bsd" -*- */
#if !defined( _pgp_dsa )
#define _pgp_dsa

#include <openssl/dsa.h>

#define PGP_ERR_FAIL -1
#define PGP_ERR_NOT_IMPLEMENTED -2
#define PGP_ERR_BAD_MSG -3
#define PGP_ERR_BAD_SIG -4

#define PGP_KEYID_SIZE 8

#define byte unsigned char 
#define uint16_t unsigned short
#define uint32_t unsigned int

/* not implemented, use GPG, or PGP */

/* int pgp_generate_dsa_key( DSA* dsa ); */
/* int pgp_write_dsa_key( byte* ptr, DSA* dsa ); */

/* VERIFYING SIGNATURES */

/* read ahead to get the keyid of the key used to sign the message */
int pgp_read_dsa_sig_keyid( const byte* ptr, byte keyid[ PGP_KEYID_SIZE ] );

/* read the key in (public or private) */
int pgp_read_dsa_key( const byte* ptr, DSA* dsa, byte keyid[ PGP_KEYID_SIZE ] );

/* check the signature */
int pgp_read_dsa_sig( const byte* ptr, DSA* dsa, byte* out, int* outlen );

/* create signature */
int pgp_write_dsa_sig_binary( byte* ptr, DSA* dsa, 
			      const byte keyid[ PGP_KEYID_SIZE ],
			      const byte* in, int len );

#endif
