打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
openssl - 获得public key
openssl - 获得public key
2008-12-05 00:45

1)

int publen;
unsigned char *buf;
EVP_PKEY *key;
publen=i2d_PublicKey(key,NULL);//得到key的长度
buf=(unsigned char *)malloc(publen);
i2d_PublicKey(key,&buf);//PublicKey DER code

2)
#include <openssl/rsa.h>

int RSA_private_encrypt(int flen, unsigned char *from,            unsigned char *to, RSA *rsa, int padding);
int RSA_public_decrypt(int flen, unsigned char *from,            unsigned char *to, RSA *rsa, int padding);

3)
#include <openssl/rsa.h>

int RSA_public_encrypt(int flen, unsigned char *from,            unsigned char *to, RSA *rsa, int padding);
int RSA_private_decrypt(int flen, unsigned char *from,            unsigned char *to, RSA *rsa, int padding);
4) typedef struct rsa_st RSA;
5)struct evp_pkey_st
{
int type;
int save_type;
int references;
union {
   char *ptr;
#ifndef OPENSSL_NO_RSA
   struct rsa_st *rsa; /* RSA */
#endif
#ifndef OPENSSL_NO_DSA
   struct dsa_st *dsa; /* DSA */
#endif
#ifndef OPENSSL_NO_DH
   struct dh_st *dh; /* DH */
#endif
#ifndef OPENSSL_NO_EC
   struct ec_key_st *ec; /* ECC */
#endif
   } pkey;
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
网络安全编程与实践(第6章 OpenSSLEVP编程 代码)
OpenSSL对PEM证书解释
OpenSSL使用指南
rsa 加密算法_zh_new
OpenSSL 编程
使用libpng,libjpeg从文件读取和从内存读取2中方式的实现
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服