http://www.w3.org/2001/04/xmldsig-more#rsa-sha256′ algoritması, ‘AsymmetricSignature’ işlemi için Basic256 algoritma paketi tarafından kabul edilmedi. hatası çözümü,error solved

http://www.w3.org/2001/04/xmldsig-more#rsa-sha256' algoritması, 'AsymmetricSignature' işlemi için Basic256 algoritma paketi tarafından kabul edilmedi.

Merhaba,

Bugünkü yazımızda sizlere aldığım System.ServiceModel.Security.MessageSecurityException: The algorithm ‘http://www.w3.org/2001/04/xmldsig-more#rsa-sha256‘ is not accepted for operation ‘AsymmetricSignature’ by algorithm suite Basic256.  hatasını nasıl çözdüğümden bahsedeceğim.

Öncelikle bilmeniz gereken kullandığınız  metodun sizden beklediği şifreleme türüdür.

Hata mesajından anlaşılacağı gibi benden beklenen SHA 256 fakat benim göndermiş olduğum Basic256.

Burda yapılması gereken imzalamanın yapıldığı yerde şifreleme türünü değiştirip kullanmak olacaktır.

 AsymmetricSecurityBindingElement deneme = new AsymmetricSecurityBindingElement()

element.DefaultAlgorithmSuite = SecurityAlgorithmSuite.Basic256;

 element.DefaultAlgorithmSuite = SecurityAlgorithmSuite.Basic128Sha256;

WSHttpBinding binding = new WSHttpBinding(); binding.Security.Mode = SecurityMode.Message; binding.Security.Message.AlgorithmSuite = System.ServiceModel.Security.SecurityAlgorithmSuite.Basic256;

yerine

  • System.ServiceModel.Security.SecurityAlgorithmSuite.Basic128Sha256

Hata detayı:

System.ServiceModel.Security.MessageSecurityException: The algorithm ‘http://www.w3.org/2001/04/xmldsig-more#rsa-sha256‘ is not accepted for operation ‘AsymmetricSignature’ by algorithm suite Basic256.

Server stack trace:   at System.ServiceModel.Security.SecurityAlgorithmSuite.EnsureAcceptableAsymmetricSignatureAlgorithm(String algorithm)   at System.ServiceModel.Security.WSSecurityOneDotZeroReceiveSecurityHeader.VerifySignature(SignedXml signedXml, Boolean isPrimarySignature, SecurityHeaderTokenResolver resolver, Object signatureTarget, String id)   at System.ServiceModel.Security.ReceiveSecurityHeader.ProcessPrimarySignature(SignedXml signedXml, Boolean isFromDecryptedSource)   at System.ServiceModel.Security.ReceiveSecurityHeader.ExecuteFullPass(XmlDictionaryReader reader)   at System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan timeout, ChannelBinding channelBinding, ExtendedProtectionPolicy extendedProtectionPolicy)   at System.ServiceModel.Security.MessageSecurityProtocol.ProcessSecurityHeader(ReceiveSecurityHeader securityHeader, Message& message, SecurityToken requiredSigningToken, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)   at System.ServiceModel.Security.AsymmetricSecurityProtocol.VerifyIncomingMessageCore(Message& message, String actor, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)   at System.ServiceModel.Security.MessageSecurityProtocol.VerifyIncomingMessage(Message& message, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)   at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)   at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)   at System.ServiceModel.Dispatcher.RequestChannelBinder.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

Soru ve iletişim için  iletişim  formundan  bana ulaşabilirsiniz.

İlerleyen yazılarda görüşmek üzere.

Oğuz ALTUNTAŞ © 2020

error: Oğuz ALTUNTAŞ © 2020