高分 求助 c# 调用 truststore格式 证书 对方给的实例都是java的,网上资料很少。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你可以看看这个,http://q.cnblogs.com/q/54288/ 谢谢楼上,一般证书是pfx格式的,但是他提供的是truststore后缀的。没有遇到过。有了解的大侠吗? 同求啊,使用X509Certificate cert = new X509Certificate(path, psw, X509KeyStorageFlags.MachineKeySet);这样获取,就报错,未处理System.Security.Cryptography.CryptographicException Message=找不到申请的对象。 Source=mscorlib StackTrace: 在 System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr) 在 System.Security.Cryptography.X509Certificates.X509Utils._QueryCertFileType(String fileName) 在 System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags) 在 System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags) 在 UnionMallSync.ICBC.ICBCApi.DoGet(String posdata) 位置 d:\EricSource\TIGER\Eshop2010.root\UnionMall\Projects\UnionMallSync\ICBC\ICBCApi.cs:行号 151 在 UnionMallSync.ICBC.ICBCApi.apiclick(String method, String data) 位置 d:\EricSource\TIGER\Eshop2010.root\UnionMall\Projects\UnionMallSync\ICBC\ICBCApi.cs:行号 130 在 UnionMallSync.ICBC.ICBCOrder.test() 位置 d:\EricSource\TIGER\Eshop2010.root\UnionMall\Projects\UnionMallSync\ICBC\ICBCOrder.cs:行号 101 在 UnionMallPRO.test.button205_Click(Object sender, EventArgs e) 位置 d:\EricSource\TIGER\Eshop2010.root\UnionMall\Projects\UnionMallPRO\test.cs:行号 2398 在 System.Windows.Forms.Control.OnClick(EventArgs e) 在 System.Windows.Forms.Button.OnClick(EventArgs e) 在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) 在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.ButtonBase.WndProc(Message& m) 在 System.Windows.Forms.Button.WndProc(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) 在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) 在 System.Windows.Forms.Application.Run(Form mainForm) 在 UnionMallPRO.Program.Main() 位置 d:\EricSource\TIGER\Eshop2010.root\UnionMall\Projects\UnionMallPRO\Program.cs:行号 17 在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) 在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) 在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 在 System.Threading.ThreadHelper.ThreadStart_Context(Object state) 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 在 System.Threading.ThreadHelper.ThreadStart() InnerException: 我的证书的后缀与你的一样,我昨天又问工行的人,他们的证书是什么格式,他说是PFX格式,我在怀疑他是否给错证书了,这个 truststore后缀的证书是证书仓库,一般是放在tomcar里面,由tomcar读取的! 操作ini文件的问题 C#文件传输 关于正则表达式的一个疑问 数据库中字段的长度是nvarchar(255),使用正则表达式怎么验证. 跪求一算法,高手请进 非高手就别进来了!动态创建DataGrid控件后 某一列是模板该模板绑定2列数据如何做? 急问:关于RM或其他文件格式的文件播放 有谁对swf文件件结构有深入的了解。 如何做个应用程序如flashget,foxmail那样做出单文档界面? 请C#大虾们指点 JAVA写的一个加密工具类,求大牛改写成PHP、C#、C++、Python等版本 急急急!!!
这样获取,就报错,
未处理System.Security.Cryptography.CryptographicException
Message=找不到申请的对象。 Source=mscorlib
StackTrace:
在 System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
在 System.Security.Cryptography.X509Certificates.X509Utils._QueryCertFileType(String fileName)
在 System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags)
在 System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags)
在 UnionMallSync.ICBC.ICBCApi.DoGet(String posdata) 位置 d:\EricSource\TIGER\Eshop2010.root\UnionMall\Projects\UnionMallSync\ICBC\ICBCApi.cs:行号 151
在 UnionMallSync.ICBC.ICBCApi.apiclick(String method, String data) 位置 d:\EricSource\TIGER\Eshop2010.root\UnionMall\Projects\UnionMallSync\ICBC\ICBCApi.cs:行号 130
在 UnionMallSync.ICBC.ICBCOrder.test() 位置 d:\EricSource\TIGER\Eshop2010.root\UnionMall\Projects\UnionMallSync\ICBC\ICBCOrder.cs:行号 101
在 UnionMallPRO.test.button205_Click(Object sender, EventArgs e) 位置 d:\EricSource\TIGER\Eshop2010.root\UnionMall\Projects\UnionMallPRO\test.cs:行号 2398
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
在 System.Windows.Forms.Button.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.Run(Form mainForm)
在 UnionMallPRO.Program.Main() 位置 d:\EricSource\TIGER\Eshop2010.root\UnionMall\Projects\UnionMallPRO\Program.cs:行号 17
在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException:
,这个 truststore后缀的证书是证书仓库,一般是放在tomcar里面,由tomcar读取的!