#ifndef DST_H
#define DST_H
#ifndef HAS_DST_KEY
#define DST_KEY RES_9_DST_KEY
typedef struct dst_key {
char *dk_key_name;
int dk_key_size;
int dk_proto;
int dk_alg;
u_int32_t dk_flags;
u_int16_t dk_id;
} DST_KEY;
#endif
#define dst_init res_9_dst_init
void dst_init(void);
#ifndef __APPLE__
int dst_check_algorithm(const int);
#endif
#define dst_sign_data res_9_dst_sign_data
int dst_sign_data(const int mode,
DST_KEY *in_key,
void **context,
const u_char *data,
const int len,
u_char *signature,
const int sig_len);
#define dst_verify_data res_9_dst_verify_data
int dst_verify_data(const int mode,
DST_KEY *in_key,
void **context,
const u_char *data,
const int len,
const u_char *signature,
const int sig_len);
#define dst_read_key res_9_dst_read_key
DST_KEY *dst_read_key(const char *in_name,
const u_int16_t in_id,
const int in_alg,
const int key_type);
#define dst_write_key res_9_dst_write_key
int dst_write_key(const DST_KEY *key,
const int key_type);
#define dst_dnskey_to_key res_9_dst_dnskey_to_key
DST_KEY *dst_dnskey_to_key(const char *in_name,
const u_char *key,
const int len);
#ifndef __APPLE__
int dst_key_to_dnskey(const DST_KEY *key,
u_char *out_storage,
const int out_len);
#endif
#define dst_buffer_to_key res_9_dst_buffer_to_key
DST_KEY *dst_buffer_to_key(const char *key_name,
const int alg,
const int flags,
const int protocol,
const u_char *key_buf,
const int key_len);
#define dst_key_to_buffer res_9_dst_key_to_buffer
int dst_key_to_buffer(DST_KEY *key, u_char *out_buff, int buf_len);
#define dst_generate_key res_9_dst_generate_key
DST_KEY *dst_generate_key(const char *name,
const int alg,
const int bits,
const int exp,
const int flags,
const int protocol);
#define dst_free_key res_9_dst_free_key
DST_KEY *dst_free_key(DST_KEY *f_key);
#define dst_compare_keys res_9_dst_compare_keys
int dst_compare_keys(const DST_KEY *key1, const DST_KEY *key2);
#define dst_sig_size res_9_dst_sig_size
int dst_sig_size(DST_KEY *key);
#define dst_s_dns_key_id res_9_dst_s_dns_key_id
u_int16_t dst_s_dns_key_id(const u_char *dns_key_rdata, const int rdata_len);
#ifndef __APPLE__
u_int16_t dst_s_id_calc(const u_char *key_data, const int key_len);
#endif
#define RAW_KEY_SIZE 8192
#define SIG_MODE_INIT 1
#define SIG_MODE_UPDATE 2
#define SIG_MODE_FINAL 4
#define SIG_MODE_ALL (SIG_MODE_INIT|SIG_MODE_UPDATE|SIG_MODE_FINAL)
#define DST_FORCE_READ 0x1000000
#define DST_CAN_SIGN 0x010F
#define DST_NO_AUTHEN 0x8000
#define DST_EXTEND_FLAG 0x1000
#define DST_STANDARD 0
#define DST_PRIVATE 0x2000000
#define DST_PUBLIC 0x4000000
#define DST_RAND_SEMI 1
#define DST_RAND_STD 2
#define DST_RAND_KEY 3
#define DST_RAND_DSS 4
#define KEY_RSA 1
#define KEY_DH 2
#define KEY_DSA 3
#define KEY_PRIVATE 254
#define KEY_EXPAND 255
#define KEY_HMAC_MD5 157
#define KEY_HMAC_SHA1 158
#define UNKNOWN_KEYALG 0
#define DST_MAX_ALGS KEY_HMAC_SHA1
#define DST_FLAGS_SIZE 2
#define DST_KEY_PROT 2
#define DST_KEY_ALG 3
#define DST_EXT_FLAG 4
#define DST_KEY_START 4
#ifndef SIGN_F_NOKEY
#define SIGN_F_NOKEY 0xC000
#endif
#define SIGN_INIT_FAILURE (-23)
#define SIGN_UPDATE_FAILURE (-24)
#define SIGN_FINAL_FAILURE (-25)
#define VERIFY_INIT_FAILURE (-26)
#define VERIFY_UPDATE_FAILURE (-27)
#define VERIFY_FINAL_FAILURE (-28)
#define MISSING_KEY_OR_SIGNATURE (-30)
#define UNSUPPORTED_KEYALG (-31)
#endif