Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

How To Assign an S/MIME Certificate to a MAPI Profile for Use with Outlook?

$
0
0

 

How To Assign an S/MIME Certificate to a MAPI Profile for Use with Outlook?

 

I am using native c++ Mapi but still havent found the way


I saw this article but it doesn't help very much
http://support.microsoft.com/?kbid=312900

 

I was trying the example from above but always get ACCESSDENIED . maybe the problem is in setting but i cant find it

 

 SPropValue SecProp;

LPSPropValue lpSecProp = &SecProp;

SBinary sbCert;

LPBYTE lpbCertBlob = NULL;

ULONG cbCertBlob = 0;

// Do the work to generate lpbCertBlob (step 3) and open GUID_Dilkie profile section.

///HERE IS THE CODE WHERE THE CERTIFICATE IS SET

// Set up property tag structure for PR_SECURITY_PROFILES.

SecProp.ulPropTag = PR_SECURITY_PROFILES;

SecProp.Value.MVbin.cValues = 1;

SecProp.Value.MVbin.lpbin = &sbCert;

SecProp.Value.MVbin.lpbin->cb =m_pCertContext->cbCertEncoded; //cbCertBlob;

SecProp.Value.MVbin.lpbin->lpb = m_pCertContext->pbCertEncoded; //lpbCertBlob;

// Set properties on the profile section.

if (FAILED(hr = lpProfSect->SetProps(1, lpSecProp, NULL)))

{

printf("Error setting property on profile.\n");

}

 

THANKS

 


Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>