Problems with Signing Messages with WSE 2.0

Apr 26 2004 3:30 AM
hello , I am new to the security and the certificates concepts..I was trying these with the help of WSE 2.0 ... I am getting some errors when i try to sign a message and send to my webservice... I am using a windows client and an ASP.Net webservice.... I created an X509 certificate using the makecert tool ....I created the certificate using the command as shown below and stored it to the Trusted Root Certificate authorities folder.... makecert -sk PAB -n "CN=virtusa.com" -ss root -sr localmachine testPAB.cer My service is a simple Helloworld example and in the web.config file this is the extra configuration i made " " This is the code i used in my windows client to sign the ,essage and send X509CertificateStore certStore = X509CertificateStore.CurrentUserStore(X509CertificateStore.RootStore); certStore.OpenRead(); X509CertificateCollection certs = certStore.FindCertificateBySubjectString("virtusa"); X509Certificate cert =((X509Certificate) certs[0]); X509SecurityToken Token = new X509SecurityToken(cert); SoapContext requestCtxt = Proxy.RequestSoapContext; requestCtxt.Security.Tokens.Add(Token); requestCtxt.Security.Elements.Add(new Signature(Token)); MessageBox.Show(Proxy.HelloWorld()); This is the config settings i have made in the client side "
" But it is giving an error while executing the error is shown below An unhandled exception of type 'System.Web.Services.Protocols.SoapHeaderException' occurred in system.web.services.dll Additional information: Microsoft.Web.Services.Security.SecurityFault: An invalid security token was provided ---> System.Security.SecurityException: The certificate's trust chain could not be verified. The CERT_CHAIN_POLICY_STATUS return code is 2148204809. at Microsoft.Web.Services.Security.X509.X509CertificateChain.Verify() at Microsoft.Web.Services.Security.X509SecurityToken.VerifyTrust() at Microsoft.Web.Services.Security.X509SecurityToken.Verify() --- End of inner exception stack trace --- at Microsoft.Web.Services.Security.X509SecurityToken.Verify() at Microsoft.Web.Services.Security.Tokens.X509SecurityTokenManager.VerifyToken(SecurityToken securityToken) at Microsoft.Web.Services.Security.Security.LoadXml(XmlElement element) at Microsoft.Web.Services.Security.SecurityInputFilter.ProcessMessage(SoapEnvelope envelope) at Microsoft.Web.Services.Pipeline.ProcessInputMessage(SoapEnvelope envelope) at Microsoft.Web.Services.WebServicesExtension.BeforeDeserializeServer(SoapServerMessage message) Is it the problem with my certificate root ??..When i open my certificate and viewed the Certification Path section , i have reference of 2 certificates there one is the certificate i have made and on top of that another Root Agency certificate , which it says is invalid.......This is the message which i get when i click on Root Agency certificate.... "This CA Root certificate is not trusted because it is not in the Trusted Root Certification Authorities store."... This Root Agency certificate is available in the Intermediate Certification Authorities folder.... .......Can any one tell me where i am doing wrong..... any help is greatly appreciated Thanks in advance Sajith

Answers (2)