小编use*_*494的帖子

链接到 OpenSSL 函数中的 ENGINE_load_private_key

我正在为我的应用程序开发一个示例 OpenSSL 引擎。

#include <openssl/engine.h>

static const char *engine_id = "sample";
static const char *engine_name = "developed by Devang";

static int engine_init(ENGINE *e);  
static EVP_PKEY *load_key(ENGINE *e, const char *id, UI_METHOD *ui, void *cb);

int bind_helper(ENGINE*e, const char *id)  {
      if(!ENGINE_set_id(e, engine_id) ||
         !ENGINE_set_init_function(e, engine_init) ||
         !ENGINE_set_load_privkey_function(e, load_key))
         return 0;

  return 1;  

}

IMPLEMENT_DYNAMIC_CHECK_FN(); IMPLEMENT_DYANMIC_BIND_FN(bind_helper);

static int engine_init(ENGINE *e) 
{
    printf("In engine_init \n"); 
} 
static EVP_PKEY *load_key(ENGINE *e, const char *id, UI_METHOD *ui, void *cb) {    
    printf(" In load_key function\n"); …
Run Code Online (Sandbox Code Playgroud)

openssl openssl-engine

5
推荐指数
1
解决办法
1745
查看次数

标签 统计

openssl ×1

openssl-engine ×1