#pragma once
#include <event2/event.h>

struct sess_ticket_key
{
    size_t size;
    unsigned char name[16];
    unsigned char hmac_key[32];
    unsigned char aes_key[32];
};
enum STEK_GET_RET
{
	STEK_ERROR=-1,
	STEK_NOT_FOUND=0,
	STEK_FOUND_FRESH=1,
	STEK_FOUND_STALED=2
};
struct sess_ticket_box;
struct sess_ticket_box * sess_ticket_box_create(struct event_base * ev_base, unsigned int stek_group_num, unsigned int round_time, void * logger);
void sess_ticket_box_get_key_for_enc(struct sess_ticket_box * box, const char* sni, struct sess_ticket_key *result);
enum STEK_GET_RET sess_ticket_box_get_key_for_dec(struct sess_ticket_box * box, const char* sni, const unsigned char* key_name, struct sess_ticket_key *result);

