<docbook><section><title>ODSMailEncryptASymmetricSpecial</title><title> ODS Webmail Example for Encrypting Emails using special search of the recipient&#39;s Public Key by domain</title> ODS Webmail Example for Encrypting Emails using special search of the recipient&#39;s Public Key by domain
<para>ODS Webmail offers the feature of sending encrypted message to recipient by gathering information for the recipient using <ulink url="http://xrdprovisioning.net/specs/1.0/wd01/xrd-provisioning-1.0-wd01.html">XRD Provisioning Protocol</ulink>.</para>
<para>Assume John wants to send encrypted email message to Kate, and Kate does not share her public key to John and John does not have Kate in his <ulink url="AddressBook">AddressBook</ulink> contacts.
 Instead, when John attempts to send encrypted email message to recipient for ex: <emphasis>kate@mytest.com</emphasis>, then the system perform search by the given recipient domain, using the XRD protocol, if there is registered user in ODS with the given mail.
 In case of found, next the system checks if the user has X.509 Certificate.
 If found, request its public key.
 When the public key is retrieved successfully, the message should be send successfully and then retrieved from Kate her ODS Webmail Inbox.</para>
<para>The scenario from below describes these steps:</para>
<para> </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>
<listitem>Set the Virtuoso Server HTTP port and <ulink url="DefaultHost">DefaultHost</ulink>  from [URIQA] section in the ini section by default to be 80: <programlisting>...
[HTTPServer]
ServerPort                  = 8893
...
[URIQA]
DefaultHost = mytest.com:8893
...
</programlisting></listitem>
<listitem>Make sure, for ex.
 for Windows users, to set the domain i.e.
 <emphasis>mytest.com</emphasis> in C:\Windows\system32\drivers\etc.\host: <programlisting>...
127.0.0.1       mytest.com
...
</programlisting> </listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2">Configure ODS User and Webmail settings</bridgehead>
<orderedlist spacing="compact"><listitem>Register user John with email for ex.: <emphasis>john@yahoo.com</emphasis> <figure><graphic fileref="ODSMailEncryptASymmetricSpecial/e1.png" /></figure> </listitem>
<listitem>Register user Kate respectively with email for ex.: <emphasis>kate@mytest.com</emphasis> <figure><graphic fileref="ODSMailEncryptASymmetricSpecial/e29.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="ODSMailEncryptASymmetricSpecial/e3.png" /></figure> <figure><graphic fileref="ODSMailEncryptASymmetricSpecial/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="ODSMailEncryptASymmetricSpecial/e5.png" /></figure> <figure><graphic fileref="ODSMailEncryptASymmetricSpecial/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 imports the content of her certificate in ODS Profile Edit-&gt;Security-&gt;X.509 Certificates.
<figure><graphic fileref="ODSMailEncryptASymmetricSpecial/e30.png" /></figure> </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="ODSMailEncryptASymmetricSpecial/e12.png" /></figure> <figure><graphic fileref="ODSMailEncryptASymmetricSpecial/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="ODSMailEncryptASymmetricSpecial/e14.png" /></figure> <figure><graphic fileref="ODSMailEncryptASymmetricSpecial/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="ODSMailEncryptASymmetricSpecial/e16.png" /></figure> <figure><graphic fileref="ODSMailEncryptASymmetricSpecial/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="ODSMailEncryptASymmetricSpecial/e18.png" /></figure> <figure><graphic fileref="ODSMailEncryptASymmetricSpecial/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="ODSMailEncryptASymmetricSpecial/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="ODSMailEncryptASymmetricSpecial/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 recipient <emphasis>kate@mytest.com</emphasis> <orderedlist spacing="compact"><listitem>John goes to his Webmail instance -&gt; Write Message: <figure><graphic fileref="ODSMailEncryptASymmetricSpecial/e22.png" /></figure> </listitem>
<listitem>John recipient email <emphasis>kate@mytest.com&gt;</emphasis>: <figure><graphic fileref="ODSMailEncryptASymmetricSpecial/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="ODSMailEncryptASymmetricSpecial/e25.png" /></figure> </listitem>
<listitem>John clicks &quot;send message&quot; </listitem>
<listitem>The system perform search by the given recipient domain if there is registered user in ODS with the given mail.
 In case of found, next the system checks if the user has X.509 Certificate.
 If found, request its public key.
 When the public key is retrieved successfully, a message for successfully sending the message should be shown: <figure><graphic fileref="ODSMailEncryptASymmetricSpecial/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="ODSMailEncryptASymmetricSpecial/e27.png" /></figure> <figure><graphic fileref="ODSMailEncryptASymmetricSpecial/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="ODSMailEncryptAsymmetric">ODS Webmail Example for Encrypting Emails</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>