2

We wish to automate the process of applying a S/MIME certificate to Outlook so that it can be used for Signing and Encrypting of email. We want to be able to programmatically set security setting preferences for: the signing & encryption certificate and their corresponding algorithms.

Can we make use of Outlook MAPI or the Graph API for this purpose? Which call / field (group) should we use? Our preference is to use a C/C++ API.

  • Are you expecting someone provide you with a complex solution? SO is simple QandA resource for specific issues with the code. What you are asking is too broad. Other than "yes, everything is possible, but it takes time, resources, etc.", nobody would give you better answer. Please refer to [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) – Slava Ivanov Mar 28 '19 at 13:59
  • @SlavaIvanov Thank you! I've removed a lot of the extra info and rewrote the question to focus on what I really want to know. – Tim de Haas Apr 01 '19 at 12:41

1 Answers1

3

For anyone trying to do the same, the following script is great (or a great place to start) for setting an S/MIME certificate to Outlook including the required settings.

https://github.com/glueckkanja-pki/PKI-Configuration-Tools/blob/master/ActivateSignatures.ps1

The scripts edits the registry entry which contains the Outlook security settings. You can run the Powershell script using 'system("start [...]")' or 'CreateProcess' for example.

To answer the subquestions: I have not found a way to do this through either Outlook MAPI nor Graph API. The registry entry is: HKEY_CURRENT_USER\Software\Microsoft\Office\"version, 16.0 for me"\Outlook\Profiles\"Profile Name"\c02ebc5353d9cd11975200aa004ae40e