System.Security.Cryptography.CryptographicException 微信支付中公众号发红包时候碰到的错误。
转 留记录。我是第二个错误原因
我总结了一下出现证书无法加载的原因有以下三个
1.证书密码不正确,微信证书密码就是商户号
解决办法:请检查证书密码是不是和商户号一致
2.IIS设置错误,未加载用户配置文件
解决办法:找到网站使用的应用程序池-->右击-->高级设置-->打开如下图-->在加载用户配置文件选择true

3.如果以上两个方案都不能解决问题,就有可能是加载证书时没有给定证书存储标识
解决方法:在加载证书方法时使用以下方法,请注意第三个参数
X509Certificate2 cer = new X509Certificate2(cerPath, password, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorage
System.Security.Cryptography.CryptographicException 微信支付中公众号发红包时候碰到的错误。的更多相关文章
- .NET Core之微信支付之公众号、H5支付篇
前言 本篇主要记录微信支付中公众号及H5支付全过程. 准备篇 公众号或者服务号(并开通微信支付功能).商户平台中开通JSAPI支付.H5支付. 配置篇 公众号或者服务号中 -------开发----- ...
- System.Security.Cryptography.CryptographicException: 指定了无效的提供程序类型
这两天在调用银联在线的支付接口,把银联提供的demo代码copy过来放到自己网站上,生成通过了,但是运行的时候就报错了: 指定了无效的提供程序类型. 说明: 执行当前 Web 请求期间,出现未经处理的 ...
- System.Security.Cryptography.CryptographicException 出现了内部错误
调试微信支付退款时,需要使用pfx证书,在本地调试时没有问题,但在服务器部署时报异常:System.Security.Cryptography.CryptographicException 出现了内部 ...
- 使用证书部署出现System.Security.Cryptography.CryptographicException 错误解决方案
一.System.Security.Cryptography.CryptographicException: 找不到对象 at System.Security.Cryptography.Cryptog ...
- WCF:System.Security.Cryptography.CryptographicException: 密钥集不存在
WCF使用IIS部署时,使用x509证书验证,在创建证书并正确配置程序后,访问出现错误提示: System.Security.Cryptography.CryptographicException: ...
- "System.Security.Cryptography.CryptographicException: 拒绝访问" 问题的解决方法
.net web程序使用rsa算法进行加解密时,程序报告“System.Security.Cryptography.CryptographicException: 拒绝访问”错.按网上搜的解决方法做了 ...
- 部署时,出现用户代码未处理 System.Security.Cryptography.CryptographicException 错误解决方法
转载:http://www.cnblogs.com/jys509/p/4499978.html 在调用RSA加密的.pfx密钥时,在本地调试没有问题,可以布署到服务器,就会报以下的错误: 用户代码未处 ...
- WebApi 数据保护操作未成功。这可能是由于未为当前线程的用户上下文加载用户配置文件导致的。当线程执行模拟时,可能会出现此情况。","ExceptionType":"System.Security.Cryptography.CryptographicException","StackTrace
在调用System.Security.Cryptography.ProtectedData.Protect方法来保护私密信息时,IIS可能会报以下错误:CryptographicException: ...
- System.Security.Cryptography.CryptographicException
在调用System.Security.Cryptography.ProtectedData.Protect方法来保护私密信息时,IIS可能会报以下错误:CryptographicException: ...
随机推荐
- Memcache+Cookie替代Session解决方案(MVC版)
阅读目录 开始 通过IHttpModule注册过滤管道方式 通过BaseController 关于滑动过期 两种方式 回到顶部 通过IHttpModule注册过滤管道方式 具体实现如下: 声明一个类C ...
- IE8下window.open 二次无法加载页面
我原先的IE是系统默认自带的IE7,升级到IE8之后,就出现了此现象: 打开一个窗口(window.open方式)后,再打开时,新窗口的页面显示空白,无法加载其内容.关闭ie后,重新偿亦是如此,第一次 ...
- PMBOK项目管理相关知识梳理
该次梳理,依据PMBOK(第五版),罗列项目管理十三章节重要的知识点. 一.引论1.项目的定义与举例:2.项目.项目组合.项目集与项目组织管理:3.范进本质是风资(范围.进度.成本.质量.风险.资源) ...
- nutch2.1+mysql+elasticsearch整合linux单机部署
这次主要介绍下nutch2.1和mysql和elasticsearch的整合,是在单机上运行,并不是分布式部署.1.下载nutch2.1 nutch下载地址:http://labs.mop.com/a ...
- NLP常用开源/免费工具
一些常见的NLP任务的开源/免费工具, *Computational Linguistics ToolboxCLT http://complingone.georgetown.edu/~linguis ...
- Performance profile of a typical interior scene
------------------------------- Num faces: 7000k+ Num lights: 38 Num textures: 79 Textures on disk: ...
- mysql into outfile 和 load data local备份还原
在 my.ini 的 [mysqld] 节点增加如下配置: secure-file-priv="D:/mysql_secure_file" max_allowed_packet= ...
- leetcode 213. 打家劫舍 II JAVA
题目: 你是一个专业的小偷,计划偷窃沿街的房屋,每间房内都藏有一定的现金.这个地方所有的房屋都围成一圈,这意味着第一个房屋和最后一个房屋是紧挨着的.同时,相邻的房屋装有相互连通的防盗系统,如果两间相邻 ...
- css3滚动条
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- “全栈2019”Java第五十章:继承与构造方法详解
难度 初级 学习时间 10分钟 适合人群 零基础 开发语言 Java 开发环境 JDK v11 IntelliJ IDEA v2018.3 文章原文链接 "全栈2019"Java第 ...