Conversion of public key from .PEM file to .XML format for Outlook Actionable Messages Signed Card configuration


Description

Outlook actionable messages can be used to create embedded survey where the survey form is rendered for users embedded in email body and users can take action directly.

If spam filtering is used in Office 365, sometimes, the embedded survey does not render in the email client. 

Microsoft allows to implement signed cards feature to fix the above issue. This procedure requires creation of JKS keystore and the public key from Servicenow should be uploaded at Microsoft O365 application.

Release or Environment

Newyork and above

Instructions

Below link from Microsoft docs site has the code in C#, which helps in converting the PEM file to XML format.

https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.publickey?view=netframework-4.8

Here is the exact line that does the conversion :

Console.WriteLine("{0}Certificate to XML String: {1}{0}", Environment.NewLine, x509.PublicKey.Key.ToXmlString(false)); 

x509 is the variable that holds the PEM certificate object. The output of the above statement can be captured to a variable and saved in a notepad file. Save the file with .xml extension.

The same logic can be used to create custom code in any other programming language, if not C#.