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.Serv ices.Protocols. SoapException: Server was unable to process
request. ---System.Security .Cryptography.C ryptographicExc eption: 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
'BAF779D423F509 BC5CD55E9AF0475 AC8468521C9'. --->
System.Security .Cryptography.C ryptographicExc eption: WSE593: Unable to
decrypt the key. Please check if the process has the right permission to
access the private key. --->
System.Security .Cryptography.C ryptographicExc eption: Bad Key..... at
System.Security .Cryptography.C ryptographicExc eption.ThrowCry ptogaphicExcept ion(Int32
hr).. at System.Security .Cryptography.U tils._DecryptKe y(SafeKeyHandle
hPubKey, Byte key, Int32 dwFlags).. at
System.Security .Cryptography.R SACryptoService Provider.Decryp t(Byte rgb,
Boolean fOAEP).. at
Microsoft.Web.S ervices3.graphy .RSA15KeyExchan geFormatter.Dec ryptKey(Byte
cipherKey).. --- End of inner exception stack trace ---.. at
Microsoft.Web.S ervices3.Securi ty.Cryptography .RSA15KeyExchan geFormatter.Dec ryptKey(Byte
cipherKey).. at Microsoft.Web.S ervices3.Securi ty.EncryptedKey .Decrypt().. ---
End of inner exception stack trace ---.. at
Microsoft.Web.S ervices3.Securi ty.EncryptedKey .Decrypt().. at
Microsoft.Web.S ervices3.Securi ty.Security.Loa dXml(XmlElement element).. at
Microsoft.Web.S ervices3.Securi ty.SecurityInpu tFilter.Process Message(SoapEnv elope
envelope).. at
Microsoft.Web.S ervices3.Securi ty.Wse2Pipeline Policy.LegacyFi lterWrapper.Pro cessMessage(Soa pEnvelope
envelope).. at
Microsoft.Web.S ervices3.Pipeli ne.ProcessInput Message(SoapEnv elope envelope)..
at Microsoft.Web.S ervices3.WsePro tocol.FilterReq uest(SoapEnvelo pe
requestEnvelope ).. at
Microsoft.Web.S ervices3.WsePro tocol.RouteRequ est(SoapServerM essage message)..
at System.Web.Serv ices.Protocols. SoapServerProto col.Initialize( ).. at
System.Web.Sevi ces.Protocols.S erverProtocolFa ctory.Create(Ty pe 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.Serv ices.Protocols. SoapException: Server was unable to process
request. ---System.Security .Cryptography.C ryptographicExc eption: 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
'BAF779D423F509 BC5CD55E9AF0475 AC8468521C9'. --->
System.Security .Cryptography.C ryptographicExc eption: WSE593: Unable to
decrypt the key. Please check if the process has the right permission to
access the private key. --->
System.Security .Cryptography.C ryptographicExc eption: Bad Key..... at
System.Security .Cryptography.C ryptographicExc eption.ThrowCry ptogaphicExcept ion(Int32
hr).. at System.Security .Cryptography.U tils._DecryptKe y(SafeKeyHandle
hPubKey, Byte key, Int32 dwFlags).. at
System.Security .Cryptography.R SACryptoService Provider.Decryp t(Byte rgb,
Boolean fOAEP).. at
Microsoft.Web.S ervices3.graphy .RSA15KeyExchan geFormatter.Dec ryptKey(Byte
cipherKey).. --- End of inner exception stack trace ---.. at
Microsoft.Web.S ervices3.Securi ty.Cryptography .RSA15KeyExchan geFormatter.Dec ryptKey(Byte
cipherKey).. at Microsoft.Web.S ervices3.Securi ty.EncryptedKey .Decrypt().. ---
End of inner exception stack trace ---.. at
Microsoft.Web.S ervices3.Securi ty.EncryptedKey .Decrypt().. at
Microsoft.Web.S ervices3.Securi ty.Security.Loa dXml(XmlElement element).. at
Microsoft.Web.S ervices3.Securi ty.SecurityInpu tFilter.Process Message(SoapEnv elope
envelope).. at
Microsoft.Web.S ervices3.Securi ty.Wse2Pipeline Policy.LegacyFi lterWrapper.Pro cessMessage(Soa pEnvelope
envelope).. at
Microsoft.Web.S ervices3.Pipeli ne.ProcessInput Message(SoapEnv elope envelope)..
at Microsoft.Web.S ervices3.WsePro tocol.FilterReq uest(SoapEnvelo pe
requestEnvelope ).. at
Microsoft.Web.S ervices3.WsePro tocol.RouteRequ est(SoapServerM essage message)..
at System.Web.Serv ices.Protocols. SoapServerProto col.Initialize( ).. at
System.Web.Sevi ces.Protocols.S erverProtocolFa ctory.Create(Ty pe 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
Comment