当前位置: 首页 > wzjs >正文

加强网站党建频道建设seo技术专员招聘

加强网站党建频道建设,seo技术专员招聘,河南做网站推广哪个好,怎么做一个网站的步骤文章目录 openssl3.2 - 官方demo学习 - smime - smsign2.c概述笔记END openssl3.2 - 官方demo学习 - smime - smsign2.c 概述 PKCS7联合签名 从N张证书中, 分别得到N对(x509和私钥) 对明文进行签名(只是指定了bio_in和flag), 得到pkcs7* 对此pkcs7进行附加签名者的操作(指定证…

文章目录

    • openssl3.2 - 官方demo学习 - smime - smsign2.c
    • 概述
    • 笔记
    • END

openssl3.2 - 官方demo学习 - smime - smsign2.c

概述

PKCS7联合签名
从N张证书中, 分别得到N对(x509和私钥)
对明文进行签名(只是指定了bio_in和flag), 得到pkcs7*
对此pkcs7进行附加签名者的操作(指定证书和私钥), 有几个联合签名者, 就进行几次操作
将签名数据pkcs7写为密文

笔记

/*!
\file smsign2.c
\note
openssl3.2 - 官方demo学习 - smime - smsign2.cPKCS7联合签名
从N张证书中, 分别得到N对(x509*和私钥*)
对明文进行签名(只是指定了bio_in和flag), 得到pkcs7*
对此pkcs7进行附加签名者的操作(指定证书*和私钥*), 有几个联合签名者, 就进行几次操作
将签名数据pkcs7写为密文
*//** Copyright 2007-2023 The OpenSSL Project Authors. All Rights Reserved.** Licensed under the Apache License 2.0 (the "License").  You may not use* this file except in compliance with the License.  You can obtain a copy* in the file LICENSE in the source distribution or at* https://www.openssl.org/source/license.html*//* S/MIME signing example: 2 signers. OpenSSL 0.9.9 only */
#include <openssl/pem.h>
#include <openssl/pkcs7.h>
#include <openssl/err.h>#include "my_openSSL_lib.h"int main(int argc, char **argv)
{BIO *_bio_in = NULL, *_bio_out = NULL, *_bio_cert = NULL;X509 *_x509_cert1 = NULL, *_x509_cert2 = NULL;EVP_PKEY *_evp_pkey1 = NULL, *_evp_pkey2 = NULL;PKCS7 *_pkcs7 = NULL;int ret = EXIT_FAILURE;OpenSSL_add_all_algorithms();ERR_load_crypto_strings();_bio_cert = BIO_new_file("signer.pem", "r");if (!_bio_cert)goto err;_x509_cert1 = PEM_read_bio_X509(_bio_cert, NULL, 0, NULL);BIO_reset(_bio_cert);_evp_pkey1 = PEM_read_bio_PrivateKey(_bio_cert, NULL, 0, NULL);BIO_free(_bio_cert);_bio_cert = BIO_new_file("signer2.pem", "r");if (!_bio_cert)goto err;_x509_cert2 = PEM_read_bio_X509(_bio_cert, NULL, 0, NULL);BIO_reset(_bio_cert);_evp_pkey2 = PEM_read_bio_PrivateKey(_bio_cert, NULL, 0, NULL);if (!_x509_cert2 || !_evp_pkey2)goto err;_bio_in = BIO_new_file("sign.txt", "r");if (!_bio_in)goto err;_pkcs7 = PKCS7_sign(NULL, NULL, NULL, _bio_in, PKCS7_STREAM | PKCS7_PARTIAL);if (!_pkcs7)goto err;/* Add each signer in turn */if (!PKCS7_sign_add_signer(_pkcs7, _x509_cert1, _evp_pkey1, NULL, 0))goto err;if (!PKCS7_sign_add_signer(_pkcs7, _x509_cert2, _evp_pkey2, NULL, 0))goto err;_bio_out = BIO_new_file("smout.txt", "w");if (!_bio_out)goto err;/* NB: content included and finalized by SMIME_write_PKCS7 */if (!SMIME_write_PKCS7(_bio_out, _pkcs7, _bio_in, PKCS7_STREAM))goto err;ret = EXIT_SUCCESS;err:if (ret != EXIT_SUCCESS) {fprintf(stderr, "Error Signing Data\n");ERR_print_errors_fp(stderr);}PKCS7_free(_pkcs7);X509_free(_x509_cert1);EVP_PKEY_free(_evp_pkey1);X509_free(_x509_cert2);EVP_PKEY_free(_evp_pkey2);BIO_free(_bio_in);BIO_free(_bio_out);BIO_free(_bio_cert);return ret;
}

END

http://www.dtcms.com/wzjs/446584.html

相关文章:

  • 策划公司组织结构图南昌seo优化公司
  • 做sns网站需要什么广州白云区今天的消息
  • 营销型网站知识上海抖音推广
  • 所有爱做网站近期网络营销的热点事件
  • vs2010网站开发登录代码市场调研报告最佳范文
  • 想做一个静态网页网站不需要有后台数据库seo关键词排名优化方法
  • 设计日本网站长沙百度快速优化
  • 石家庄网站建设石家庄seo点击软件哪个好用
  • 手机上怎么做网站百度官网进入
  • 网站上怎么做动画广告视频在线观看电商还有发展前景吗
  • 国际军事新闻头条郑州专业seo首选
  • 公司转让流程seo规范培训
  • 网站突然消失了视频网站推广
  • 动态网站开发考证seo l
  • 温岭住房和城乡建设委员会网站线上营销的优势
  • 网站建设案例行业现状郑州网站建设十大公司
  • 网投网站制作外贸网站推广费用
  • 苍南建设网站优化的含义
  • 制作网页设计软件列表代码seo费用
  • 网站建设技术百科小红书推广策略
  • 安徽专业网站建设设计免费源码资源源码站
  • 网站建设一定要公司吗南京seo网站优化推广
  • 电脑版 做网站尺寸企业官网怎么做
  • 深圳市建设科技促进中心网站泉州百度网络推广
  • 门户网站和网站的区别企业网站分析报告
  • 东莞虎门网站设计今日头条(官方版本)
  • 网站建设大作业西安seo
  • 做网站 做推广需要知道什么收录平台
  • 网站建设方案选公司广告留电话号的网站
  • 顺德网站建优化大师使用方法