Cannot instantiate a X509SecurityToken object in MFC C++

From: kenneth (kenneth_at_discussions.microsoft.com)
Date: 03/30/05


Date: Wed, 30 Mar 2005 06:47:04 -0800

Hello,

I am trying to incorporate security into my Web Service. I am attempting to
have my client (MFC C++) connect to my .net Web Service (C#) in a secure
manner. The first thing I am doing is trying to obtain a certificate:

-------------
//First action to do is to retrieve a certificate that will be added to the
SOAP message
X509CertificateStore *store =
X509CertificateStore::CurrentUserStore(X509CertificateStore::RootStore->ToString());
store->OpenRead();
X509CertificateCollection *col =
(X509CertificateCollection*)store->FindCertificateBySubjectString("");
        
if( col->Count == 0 )
return;
        
X509Certificate* cert = col->get_Item(0);
X509SecurityToken* x509st = new X509SecurityToken(cert);
----------------

However, I receive the following error:
 error C3828: 'Microsoft::Web::Services::Security::X509SecurityToken':
placement arguments not allowed while creating instances of managed classes

Could someone give me any pointers as to what I am doign wrong? Or if
possible, send me some code snippets on how to do this in MFC C++?

Thanks for any help offered!



Relevant Pages

  • Re: WSE 2.0 Policy security settings with multiple X.509 certifica
    ... Certificate Store Location is set to LocalMachine (for the Web Service ... "Trusted Client Certificates" is made from "Local Machine - Other People" ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: Using Microsoft Certificate Server Programatically
    ... Client contacts server (web service) with encrypted registration ... The server issues the certificate (not sure how the web service ...
    (microsoft.public.platformsdk.security)
  • Re: WCF endpoint certificate identity
    ... When web services have certificates involved and are used at the message level I believe the update process would be to re-send the WSDL to the client. ... Some documentation says that "This element specifies a Base64-encoded X.509 certificate value to compare with the client." ... When the web service owner decides to change the certfificate, ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Referenced security token could not be retrieved
    ... I'm attempting to call a .Net Web Service from a Java client and I always ... I created a simple Hello World Web Service and then enabled WSSE for the ... I exported this certificate to a file and then imported it ... BEGIN FULL SOAP MESSAGE REQUEST ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: HTTPS web service connection errors
    ... Last week the hosts of the web service installed a new signed ... As soon as they installed the new certificate, ... Java web app stopped working. ... your Java installation does not have the key to validate it. ...
    (comp.lang.java.programmer)