gpt4 book ai didi

c# - 访问证书时出错 : Keyset Does Not Exist

转载 作者:太空宇宙 更新时间:2023-11-03 15:34:35 25 4
gpt4 key购买 nike

我最近更新了两个 Windows 控制台应用程序的证书。过去我们刚刚续订了证书,但这次不可能,因为我们的第 3 方提供商不再允许这样做。这次创建了一个名称略有修改的新证书。两个应用程序使用此证书,一个正在运行,另一个在每次运行时都会出现以下错误。

Exception (CryptographicException)
System.Security.Cryptography.CryptographicException: Keyset does not exist
Server stack trace: at
System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer) at
System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle) at
System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair() at
System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey() at
System.IdentityModel.Tokens.X509AsymmetricSecurityKey.get_PrivateKey() at
System.IdentityModel.Tokens.X509AsymmetricSecurityKey.GetSignatureFormatter(String algorithm) at
System.IdentityModel.SignedXml.ComputeSignature(SecurityKey signingKey) at
System.ServiceModel.Security.WSSecurityOneDotZeroSendSecurityHeader.CompletePrimarySignatureCore(SendSecurityHeaderElement[] signatureConfirmations, SecurityToken[] signedEndorsingTokens, SecurityToken[] signedTokens, SendSecurityHeaderElement[] basicTokens) at
System.ServiceModel.Security.SendSecurityHeader.CompleteSignature() at
System.ServiceModel.Security.SendSecurityHeader.CompleteSecurityApplication() at
System.ServiceModel.Security.SecurityAppliedMessage.OnWriteMessage(XmlDictionaryWriter writer) at
System.ServiceModel.Channels.BufferedMessageWriter.WriteMessage(Message message, BufferManager bufferManager, Int32 initialOffset, Int32 maxSizeQuota) at
System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.WriteMessage(Message message, Int32 maxMessageSize, BufferManager bufferManager, Int32 messageOffset) at
System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(Message message) at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout) at
System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout) at
System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at
System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout) at
System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at
System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at
System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]: at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

我已将证书加载到适当的证书存储区。我已授予用户完全访问权限。我已授予“所有人”访问证书的权限。我什至已经将物理文件标识为私有(private)文件,并授予用户对此的完全控制权。仍然没有成功。

以下是配置文件的摘录,用于设置访问证书的配置:

<clientCertificate
findValue="certifcatesubjectishere"
storeLocation="LocalMachine"
storeName="TrustedPeople"
x509FindType="FindBySubjectName"
/>

在此阶段,我们将不胜感激任何帮助或建议。

最佳答案

我知道现在回答为时已晚,但它可能对其他人有用。我在 IIS 中安装 WCF 应用程序时遇到了同样的问题,我用 winhttpcertcfg 解决了它.它是 Windows 用于授予/撤销证书权限的官方程序。 Here你可以找到使用说明。

关于c# - 访问证书时出错 : Keyset Does Not Exist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32272814/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com