//
// Created by 78472 on 2020/10/15.
//

#ifndef GAFFICUNITNEW_KEY_H
#define GAFFICUNITNEW_KEY_H

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdint>
#include <iostream>

#include "qlibc/httplib.h"
#include <qlibc/qlibc.h>
#include "json/json.h"

#include "cJSON.h"
#include "mlssl.h"
#include "crypt.h"
#include "lancommn.h"


#ifdef __cplusplus
extern "C"
{
#endif

#define UPLOAD_SCR_KEY "bothareengineers"


int getHttpReturnCode(const char *json);

int getSecretKeyFromHttpReturn(const char *json, char *key);

void * _ssl_encrypt_data(uint8_t *secKey, const void *data, size_t length, size_t *size);

uint8_t *key_generate_upload(const char *sn);

uint8_t *key_download(const char *sn);


#ifdef __cplusplus
}
#endif

#endif //GAFFICUNITNEW_KEY_H
