G
Guest
Can someone help with the following problem. I am sending an encrypted SOAP
message to a .NET 2.0 + WSE 3.0 web service. When .NET attempts to decrypt
the message it cannot read the private key of the X509 token it requires (or
so it says). I have followed the instructions in the error message and given
the userid full access to the certificate. I have also tried running .NET
under my administrators userid which was used to create the self-signed
certificate using makecert and it still says it cant access it.
So, my belief is that the error message is misleading. Ive googled on it
and tried every suggestion I can see. Ive re-installed .NET and WSE 3 on
another machine and still get the same problem. Ive rebuilt the apps, given
access to all directories above the private key, tried several different
combinations of makecert options and still cant crack it.
I need to understand what I can do to debug the error. Is there internal
trace I can switch on?
Here is the stack trace I get back in my requesting application
System.Web.Services.Protocols.SoapException: Server was unable to process
request. ---> System.Security.Cryptography.CryptographicException: WSE600:
Unable to unwrap a symmetric key using the private key of an X.509
certificate. Please check if the account 'TEST\admin' has permissions to read
the private key of certificate with subject name 'CN=MSFT9' and thumbprint
'BAF779D423F509BC5CD55E9AF0475AC8468521C9'. --->
System.Security.Cryptography.CryptographicException: WSE593: Unable to
decrypt the key. Please check if the process has the right permission to
access the private key. --->
System.Security.Cryptography.CryptographicException: Bad Key..... at
System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32
hr).. at System.Security.Cryptography.Utils._DecryptKey(SafeKeyHandle
hPubKey, Byte key, Int32 dwFlags).. at
System.Security.Cryptography.RSACryptoServiceProvider.Decrypt(Byte rgb,
Boolean fOAEP).. at
Microsoft.Web.Services3.graphy.RSA15KeyExchangeFormatter.DecryptKey(Byte
cipherKey).. --- End of inner exception stack trace ---.. at
Microsoft.Web.Services3.Security.Cryptography.RSA15KeyExchangeFormatter.DecryptKey(Byte
cipherKey).. at Microsoft.Web.Services3.Security.EncryptedKey.Decrypt().. ---
End of inner exception stack trace ---.. at
Microsoft.Web.Services3.Security.EncryptedKey.Decrypt().. at
Microsoft.Web.Services3.Security.Security.LoadXml(XmlElement element).. at
Microsoft.Web.Services3.Security.SecurityInputFilter.ProcessMessage(SoapEnvelope
envelope).. at
Microsoft.Web.Services3.Security.Wse2PipelinePolicy.LegacyFilterWrapper.ProcessMessage(SoapEnvelope
envelope).. at
Microsoft.Web.Services3.Pipeline.ProcessInputMessage(SoapEnvelope envelope)..
at Microsoft.Web.Services3.WseProtocol.FilterRequest(SoapEnvelope
requestEnvelope).. at
Microsoft.Web.Services3.WseProtocol.RouteRequest(SoapServerMessage message)..
at System.Web.Services.Protocols.SoapServerProtocol.Initialize().. at
System.Web.Sevices.Protocols.ServerProtocolFactory.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing).. --- End of inner exception stack trace ---</
I am using Windows XP with IIS 5.1, .NET 2 and WSE 3.0
Thanks, Dan
message to a .NET 2.0 + WSE 3.0 web service. When .NET attempts to decrypt
the message it cannot read the private key of the X509 token it requires (or
so it says). I have followed the instructions in the error message and given
the userid full access to the certificate. I have also tried running .NET
under my administrators userid which was used to create the self-signed
certificate using makecert and it still says it cant access it.
So, my belief is that the error message is misleading. Ive googled on it
and tried every suggestion I can see. Ive re-installed .NET and WSE 3 on
another machine and still get the same problem. Ive rebuilt the apps, given
access to all directories above the private key, tried several different
combinations of makecert options and still cant crack it.
I need to understand what I can do to debug the error. Is there internal
trace I can switch on?
Here is the stack trace I get back in my requesting application
System.Web.Services.Protocols.SoapException: Server was unable to process
request. ---> System.Security.Cryptography.CryptographicException: WSE600:
Unable to unwrap a symmetric key using the private key of an X.509
certificate. Please check if the account 'TEST\admin' has permissions to read
the private key of certificate with subject name 'CN=MSFT9' and thumbprint
'BAF779D423F509BC5CD55E9AF0475AC8468521C9'. --->
System.Security.Cryptography.CryptographicException: WSE593: Unable to
decrypt the key. Please check if the process has the right permission to
access the private key. --->
System.Security.Cryptography.CryptographicException: Bad Key..... at
System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32
hr).. at System.Security.Cryptography.Utils._DecryptKey(SafeKeyHandle
hPubKey, Byte key, Int32 dwFlags).. at
System.Security.Cryptography.RSACryptoServiceProvider.Decrypt(Byte rgb,
Boolean fOAEP).. at
Microsoft.Web.Services3.graphy.RSA15KeyExchangeFormatter.DecryptKey(Byte
cipherKey).. --- End of inner exception stack trace ---.. at
Microsoft.Web.Services3.Security.Cryptography.RSA15KeyExchangeFormatter.DecryptKey(Byte
cipherKey).. at Microsoft.Web.Services3.Security.EncryptedKey.Decrypt().. ---
End of inner exception stack trace ---.. at
Microsoft.Web.Services3.Security.EncryptedKey.Decrypt().. at
Microsoft.Web.Services3.Security.Security.LoadXml(XmlElement element).. at
Microsoft.Web.Services3.Security.SecurityInputFilter.ProcessMessage(SoapEnvelope
envelope).. at
Microsoft.Web.Services3.Security.Wse2PipelinePolicy.LegacyFilterWrapper.ProcessMessage(SoapEnvelope
envelope).. at
Microsoft.Web.Services3.Pipeline.ProcessInputMessage(SoapEnvelope envelope)..
at Microsoft.Web.Services3.WseProtocol.FilterRequest(SoapEnvelope
requestEnvelope).. at
Microsoft.Web.Services3.WseProtocol.RouteRequest(SoapServerMessage message)..
at System.Web.Services.Protocols.SoapServerProtocol.Initialize().. at
System.Web.Sevices.Protocols.ServerProtocolFactory.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing).. --- End of inner exception stack trace ---</
I am using Windows XP with IIS 5.1, .NET 2 and WSE 3.0
Thanks, Dan