#include <stdio.h>
#include "cryptlib.h"
#include <openssl/x509.h>
#include <openssl/asn1.h>
#include <openssl/dh.h>
#include <openssl/bn.h>
#include "asn1_locl.h"
#ifndef OPENSSL_NO_CMS
# include <openssl/cms.h>
#endif
extern const EVP_PKEY_ASN1_METHOD dhx_asn1_meth;
/*编码,证书公私钥编码解码,dh参数编码解码,dh拷贝打印等操作,CMS对消息的加密解密*/
/*
* i2d/d2i like DH parameter functions which use the appropriate routine for
* PKCS#3 DH or X9.42 DH.
*/
//编码转换函数i2d和d2i,i2d将一个内部的结构(c语言结构体)转换成DER编码(描述证书)的对象,
//d2i系列函数将一个DER编码的对象转换为一个内部的结构(c语言结构体)
static DH *d2i_dhp(const EVP_PKEY *pkey, const unsigned char **pp,
long length) //pp是指向DER编码字符指针的指针,length是*pp数据长度
{
{
if (pkey->ameth == &dhx_asn1_meth)
return d2i_DHxparams(NULL, pp, length);
return d2i_DHparams(NULL, pp, length);
}
//a指向结构体,pp是指向DER编码字符指针的指针
static int i2d_dhp(const EVP_PKEY *pkey,
openssl开源程序dh算法解析之dh_ameth.c
最新推荐文章于 2024-04-18 05:18:11 发布