/*
 * @Author: ybzhou yibo.zhou@lnxall.com
 * @Date: 2026-08-08 14:28:41
 * @LastEditors: ybzhou yibo.zhou@lnxall.com
 * @LastEditTime: 2026-08-08 17:40:55
 * @FilePath: /release-v2.10.x/proto_forward/src/frpc_cut/rsa.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#ifndef _RSA_H
#define _RSA_H


#include <openssl/evp.h>
#include <openssl/pem.h>
#include <openssl/rsa.h>        // 用于 RSA_*_PADDING 常量
#include <openssl/err.h>

#include "frpc_cut.h"


#define FRPC_PRIVATE_KEY "private_key.pem"
#define FRPC_PUBLIC_KEY  "public_key.pem"


#define RSA_PUBLIC_KEY_PATH  FRPC_CFG_PATH"/"FRPC_PUBLIC_KEY
#define RSA_PRIVATE_KEY_PATH FRPC_CFG_PATH"/"FRPC_PRIVATE_KEY
#define RSA_PASSWD           "lnxall"

int rsa_encrypt_b64(char *str, size_t str_len);
int rsa_decrypt_b64(char *str, size_t str_len);


#endif
