#include <iostream>
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <openssl/buffer.h>
using namespace std;
int Base64Encode(const unsigned char* in, int len, char* out_base64)
{
if (!in || len <= 0 || !out_base64)
return 0;
//内存源 source
auto mem_bio = BIO_new(BIO_s_mem());
if (!mem_bio)return 0;
//base64 filter
auto b64_bio = BIO_new(BIO_f_base64());
if (!b64_bio)
{
BIO_free
使用openssl BIO接口实现base64编解码
最新推荐文章于 2024-09-12 10:00:36 发布