<docbook><section><title>ODSMailEncryptAsymmetric</title><title> ODS Webmail Example for Encrypting Emails using Asymmetric Key Technology</title> ODS Webmail Example for Encrypting Emails using Asymmetric Key Technology
<para>Assume the following scenario where John sends encrypted email message to Kate:</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2">Prerequisites</bridgehead>
<orderedlist spacing="compact"><listitem>Perform the steps from the <ulink url="OdsMailInstallGuide">Virtuoso ODS-Mail Installation Guide</ulink>.
<itemizedlist mark="bullet" spacing="compact"><listitem>In our example we will use for domain name: mytest.com </listitem>
</itemizedlist></listitem>
<listitem>Install the ODS Addressbook vad package: <ulink url="https://virtuoso.openlinksw.com/download/"><span style="color: red">
      UNKNOWN tag:
      http://www.w3.org/1999/xhtml:nowikiods_addressbook_dav</span>.vad</ulink></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2">Configure ODS User and Webmail settings</bridgehead>
<orderedlist spacing="compact"><listitem>Register two users in ODS: John and Kate respectively with emails for ex.: <emphasis>john@yahoo.com</emphasis> and <emphasis>kate@yahoo.com</emphasis> <figure><graphic fileref="ODSMailEncryptAsymmetric/e1.png" /></figure> <figure><graphic fileref="ODSMailEncryptAsymmetric/e2.png" /></figure> </listitem>
<listitem>John and Kate create ODS Webmail instances: <orderedlist spacing="compact"><listitem>Go to Application Settings -&gt;Application Management and click &quot;New Web Application&quot; button: <figure><graphic fileref="ODSMailEncryptAsymmetric/e3.png" /></figure> <figure><graphic fileref="ODSMailEncryptAsymmetric/e4.png" /></figure> </listitem>
<listitem>Click &quot;Create Application&quot; for application type &quot;Mail&quot;.
</listitem>
<listitem>In the presented form choose domain &quot;mytest.com&quot;: <figure><graphic fileref="ODSMailEncryptAsymmetric/e5.png" /></figure> <figure><graphic fileref="ODSMailEncryptAsymmetric/e6.png" /></figure> </listitem>
<listitem>Click &quot;Create and Launch Application&quot; </listitem>
</orderedlist></listitem>
<listitem>John <ulink url="ODSGenerateX509Certificate">creates X.509 Certificate</ulink> with mail <emphasis>john@mytest.com</emphasis>.
</listitem>
<listitem>Kate <ulink url="ODSGenerateX509Certificate">creates X.509 Certificate</ulink> with mail <emphasis>kate@mytest.com</emphasis>.
</listitem>
<listitem>John exports his X.509 Certificate, for ex.
 to local file with name <emphasis>john.p12</emphasis>.
</listitem>
<listitem>Kate exports her X.509 Certificate, for ex.
 to local file with name <emphasis>kate.p12</emphasis>.
</listitem>
<listitem>Kate extracts her Public Key and shares it to John: <programlisting>$ openssl pkcs12 -in kate.p12 -out KatePublicKey.pem -clcerts -nokeys
Enter Import Password:*******
MAC verified OK
</programlisting><itemizedlist mark="bullet" spacing="compact"><listitem>Suppose the generated Public Key KatePublicKey.pem has the following content: <programlisting>Bag Attributes
    friendlyName: kate&#39;s OpenLink Software, Inc. ID #2
    localKeyID: 86 14 1A E2 08 CD 05 DC 37 37 04 ED A3 A9 7A 2E AF 7C 3D F2 
subject=/CN=kate/C=US/O=OL/emailAddress=kate@mytest.com
issuer=/C=US/ST=MA/O=OpenLink Software, Inc./OU=Virtuoso/CN=Root CA/emailAddress=ods@openlinksw.com
-----BEGIN CERTIFICATE-----
MIID3zCCAsegAwIBAgIBRjANBgkqhkiG9w0BAQQFADCBhDELMAkGA1UEBhMCVVMx
CzAJBgNVBAgTAk1BMSAwHgYDVQQKExdPcGVuTGluayBTb2Z0d2FyZSwgSW5jLjER
MA8GA1UECxMIVmlydHVvc28xEDAOBgNVBAMTB1Jvb3QgQ0ExITAfBgkqhkiG9w0B
CQEWEm9kc0BvcGVubGlua3N3LmNvbTAeFw0xMTA2MTUxMjM5MzZaFw0yMzExMTEw
NDM5MzZaMEkxDTALBgNVBAMTBGthdGUxCzAJBgNVBAYTAlVTMQswCQYDVQQKEwJP
TDEeMBwGCSqGSIb3DQEJARYPa2F0ZUBteXRlc3QuY29tMIIBIjANBgkqhkiG9w0B
AQEFAAOCAQ8AMIIBCgKCAQEAuObpEatzo88cyFILUhdW/TRCoyt6e5r8e8+bL6Cd
f0/Yuz9KcSEEUdnobB59EdOa0t9vQ+dAimVBOeRceDz666KUD0UouICKENNUfLCK
MTyGlRr9lzmDpw3hlfIJ7ODtBHQhTD99CPc1E8dksRhWfeMwr7hc+qkT7EJEw1Y9
VYnjTWYPX8UrxVDcg2v9+edoCmA4BjiClb0+y2CMtdSJqGxPyjDBvqCl0cTC2Kpj
4o4WreEDhVS/MBmlj1njxst2TZKm4WDC1XnbHsR8x/HDVnip9yju5z/2l65jviYp
IbAp+WSHpTk4x/hWz3PmyxyyUKpTV4THxZTqSCXD3diJ/wIDAQABo4GVMIGSMB0G
A1UdDgQWBBRBa9q230F9filCpYGDwcMqiGVL8jBCBgNVHREEOzA5hjdodHRwOi8v
b2RzLXFhLm9wZW5saW5rc3cuY29tL2RhdGFzcGFjZS9wZXJzb24va2F0ZSN0aGlz
MC0GCWCGSAGG+EIBDQQgFh5WaXJ0dW9zbyBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUw
DQYJKoZIhvcNAQEEBQADggEBACS1UtjcZnuVD4rH5Bzdpgg/lwwf3w8xN2HVhH20
4akMT9PvNVQaxcprBCLTmfXZ7mi14GiGvkKND/3wdDrp+06J3NE28/0uYPL6HS4b
Uak9U4PRXcsLKTyHSnZ6zHll/cQ4f8V9U4Wjm2/BXxNeOdEB2U3NVG1lhc2xBBs8
NkXNl78xb9ME99EIaZKuASPBspY+tWPmofL0DPGH32hsPDGLrKWR/RAE1EqItyJe
p4+Fdm5sD7xgzHNuPLj9YYRfxHq31Al7cZZYh9fdvCYJQZDNDulxySqFI+tZ7SCp
EMTMShHZxJNQCF0yHO4d3tOIzZq3EaaYQ4FguCTH0kQ7eiE=
-----END CERTIFICATE-----

</programlisting></listitem>
</itemizedlist></listitem>
<listitem>John creates ODS <ulink url="AddressBook">AddressBook</ulink> instance: from &quot;Application Settings -&gt;Application Management&quot; or click &quot;<ulink url="AddressBook">AddressBook</ulink>&quot; from the left vertical navigation: <figure><graphic fileref="ODSMailEncryptAsymmetric/e7.png" /></figure> </listitem>
<listitem>John adds a new <ulink url="AddressBook">AddressBook</ulink> contact with name &quot;Kate&quot;: <orderedlist spacing="compact"><listitem>In the <ulink url="AddressBook">AddressBook</ulink> UI, click &quot;New contact&quot;: <figure><graphic fileref="ODSMailEncryptAsymmetric/e8.png" /></figure> </listitem>
<listitem>In the presented &quot;Main&quot; tab enter &quot;name&quot;: Kate <figure><graphic fileref="ODSMailEncryptAsymmetric/e9.png" /></figure> </listitem>
<listitem>Go to tab &quot;Contact&quot; and enter &quot;Mail&quot;: <ulink url="kate@mytest.com">kate@mytest.com</ulink> <figure><graphic fileref="ODSMailEncryptAsymmetric/e10.png" /></figure> </listitem>
<listitem>Go to tab &quot;X.509 Certificate&quot; and enter the content of the Public Key from above for Kate: KatePublicKey.pem: <figure><graphic fileref="ODSMailEncryptAsymmetric/e11.png" /></figure> </listitem>
</orderedlist></listitem>
<listitem>John and Kate set in their ODS Profile a Private Key: <orderedlist spacing="compact"><listitem>Go to Profile -&gt;Edit -&gt;Security-&gt;Certificate &amp; Private Key <figure><graphic fileref="ODSMailEncryptAsymmetric/e12.png" /></figure> <figure><graphic fileref="ODSMailEncryptAsymmetric/e13.png" /></figure> </listitem>
<listitem>Click &quot;Import key from local file&quot; and respectively for John select his certificate john.p12 and for Kate select her certificate kate.p12: <figure><graphic fileref="ODSMailEncryptAsymmetric/e14.png" /></figure> <figure><graphic fileref="ODSMailEncryptAsymmetric/e15.png" /></figure> </listitem>
<listitem>Enter &quot;Key Name&quot; for ex.
 respectively for John: <emphasis><ulink url="JohnKey">JohnKey</ulink></emphasis> and for Kate: <emphasis><ulink url="KateKey">KateKey</ulink></emphasis> and provide the certificate password: <figure><graphic fileref="ODSMailEncryptAsymmetric/e16.png" /></figure> <figure><graphic fileref="ODSMailEncryptAsymmetric/e17.png" /></figure> </listitem>
<listitem>Click &quot;Import Key&quot; </listitem>
<listitem>As result for both John and Kate should be displayed in the Certificate &amp; Private Key List the imported certificate: <figure><graphic fileref="ODSMailEncryptAsymmetric/e18.png" /></figure> <figure><graphic fileref="ODSMailEncryptAsymmetric/e19.png" /></figure> </listitem>
</orderedlist></listitem>
<listitem>John configures his Webmail Settings: <orderedlist spacing="compact"><listitem>Go to Webmail instance-&gt;Preferences and set: <orderedlist spacing="compact"><listitem>For &quot;Encryption (with certificate)&quot;: select the &quot;<ulink url="JohnKey">JohnKey</ulink>&quot; key.
</listitem>
<listitem>Select &quot;Required (can&#39;t send message unless all recipients have certificates)&quot; <figure><graphic fileref="ODSMailEncryptAsymmetric/e20.png" /></figure> </listitem>
<listitem>Finally click &quot;Save&quot;to set the changes.
</listitem>
</orderedlist></listitem>
<listitem>Kate goes to her Webmail instance-&gt;Preferences and sets: <orderedlist spacing="compact"><listitem>For &quot;Encryption (with certificate)&quot;: select the &quot;<ulink url="KateKey">KateKey</ulink>&quot; key.
<figure><graphic fileref="ODSMailEncryptAsymmetric/e21.png" /></figure> </listitem>
<listitem>Finally click &quot;Save&quot;to set the changes.
</listitem>
</orderedlist></listitem>
</orderedlist></listitem>
<listitem>John sends encrypted email message to Kate: <orderedlist spacing="compact"><listitem>John goes to his Webmail instance -&gt; Write Message: <figure><graphic fileref="ODSMailEncryptAsymmetric/e22.png" /></figure> </listitem>
<listitem>For &quot;To&quot; field clicks the &quot;Select&quot; button or manually enters Kate&#39;s email <emphasis>kate@mytest.com&gt;</emphasis> <figure><graphic fileref="ODSMailEncryptAsymmetric/e23.png" /></figure> <figure><graphic fileref="ODSMailEncryptAsymmetric/e24.png" /></figure> </listitem>
<listitem>John enters &quot;Subject&quot; for ex: &quot;This is encrypted msg&quot; and &quot;Message&quot;: &quot;Simple test&quot; <figure><graphic fileref="ODSMailEncryptAsymmetric/e25.png" /></figure> </listitem>
<listitem>John clicks &quot;send message&quot; and message for successfully sending the message should be shown: <figure><graphic fileref="ODSMailEncryptAsymmetric/e26.png" /></figure> </listitem>
</orderedlist></listitem>
<listitem>Kate receives the encrypted message from John: <orderedlist spacing="compact"><listitem>Kate goes to her Webmail instance -&gt; Inbox where should be displayed the new message from John: <figure><graphic fileref="ODSMailEncryptAsymmetric/e27.png" /></figure> <figure><graphic fileref="ODSMailEncryptAsymmetric/e28.png" /></figure></listitem>
</orderedlist></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2">Related</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="OdsMail">ODS-Mail</ulink> </listitem>
<listitem><ulink url="ODSMailEncryptASymmetricSpecial">ODS Webmail Example for Encrypting Emails using special search by domain</ulink> </listitem>
<listitem><ulink url="ODSMailEncrypt">ODS Webmail Guide for Optionally Encrypting Emails</ulink> </listitem>
<listitem><ulink url="ODSMailSendDigitallySignedMsg">ODS Guide for Sending Digitally Signed Messages</ulink> </listitem>
<listitem><ulink url="ODSMailWebIDSMIME">ODS-Mail Evaluate SMIME + WebID Support Guide</ulink></listitem>
</itemizedlist><para> </para>
</section></docbook>