1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2018 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-->
<refentry id="fn_smime_encrypt">
<refmeta>
<refentrytitle>smime_encrypt</refentrytitle>
<refmiscinfo>mail</refmiscinfo>
</refmeta>
<refnamediv>
<refname>smime_encrypt</refname>
<refpurpose>Performs encryption of a (signed) e-mail msg</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="fsyn_smime_encrypt">
<funcprototype id="fproto_smime_encrypt">
<funcdef>varchar <function>smime_encrypt</function></funcdef>
<paramdef>in <parameter>mail_message</parameter> varchar</paramdef>
<paramdef>in <parameter>array_of_recipient_certificates</parameter> any</paramdef>
<paramdef>in <parameter>cipher_name</parameter> varchar</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="desc_smime_encrypt"><title>Description</title>
<para>This function performs encryption of a (signed) e-mail message.</para></refsect1>
<refsect1 id="params_smime_encrypt"><title>Parameters</title>
<refsect2><title>mail_message</title>
<para>The text of the e-mail msg.</para>
</refsect2>
<refsect2>
<title>array_of_recipient_certificates</title>
<para>An array of strings containing certificates (per format) of the recipient individuals.
The certificates must contain RSA keys. See for reference <ulink url="http://www.openssl.org/docs/crypto/PKCS7_encrypt.html">here</ulink>.
</para>
</refsect2>
<refsect2><title>cipher_name</title>
<para>Encryption algorithm 'des', 'des3', 'aes256', 'aes128' etc.</para>
</refsect2>
</refsect1>
<refsect1 id="ret_smime_encrypt"><title>Return Types</title>
<para>varchar</para>
</refsect1>
<refsect1 id="examples_smime_encrypt"><title>Examples</title>
<example id="ex_smime_encrypt"><title>Encrypting (signed) e-mail msg</title>
<programlisting><![CDATA[
SQL> select smime_encrypt (file_to_string ('test.eml'),
pem_certificates_to_array (file_to_string ('testcerts.pem')),
'aes256');
_______________________________________________________________________________
MIME-Version: 1.0
Content-Disposition: attachment; filename="smime.p7m"
Content-Type: application/x-pkcs7-mime; smime-type=enveloped-data; name="smime.p7m"
Content-Transfer-Encoding: base64
MIIDwwYJKoZIhvcNAQcDoIIDtDCCA7ACAQAxggGXMIIBkwIBADB7MHYxCzAJBgNV
BAYTAkJHMRAwDgYDVQQIEwdQbG92ZGl2MRMwEQYDVQQKEwpQcm9nZW0gT09EMQ0w
CwYDVQQLEwRMYWJzMRAwDgYDVQQDEwdSb290IENBMR8wHQYJKoZIhvcNAQkBFhBp
bWl0a29AZ21haWwuY29tAgEAMA0GCSqGSIb3DQEBAQUABIIBADWF2bOMROmztQqO
ytW7JfG3vjpk4TKHKoSnjKP0bBOSypY6/0tOzIg9jQHvl/Kay0do6gzfNbWV9SQP
UWRa0lyD9rpG9WbxStOTPzDhDhbFJ0EXr1CR0uKMoUUuY3ovWkdZx0+whhCuwwVF
pSY0vvh9P+Bw0hMUsJPsDtudti220a7A0jJ5Rz2ubcnN5A3M5Odxwr59ix93RYD/
zfQ5ETqH8zx16F1cs7uS2uD7m2uVp8mQBab4onDYzpLUWvVi/dPX3h2ifAjn25At
SmWROYd+NbyNxs9uQp4pQZ6ZEJo6dPVrsM7SfR55O3ukq5V9zOUYEVN+VJpPlGBt
Gru9tlwwggIOBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBCykjJ22Mk6baYYlP/w
PTb2gIIB4KyYoU7j4vREgvTO6zBauDnACAZO0oOdzGDuJKtLd8rTJO10ntp+CF6Y
5hAZnUefW0cCm6Pn9yMb1l5Btthek+CCscKsPTNCMSb/dBuPTbmKQcfYwlHV/Ejz
Ko5uJYMHLh8RkjHPt6nov6YZrMA82IA4KGCWxhhsQ7flHYtLG9PEWOaQr7Y+BYBs
a3sQdiGgGBwarTX+y65ERYcE32h+xnP4RW3QD8VEmhlyesG5xoALnGM4CQ9VObh1
VOTQhPRbu1PSsa4fEjbn3ey7+89mrjpYD/GwdwBEqOM0xGUZI4UBnhDwCIE/A4xX
jEdf59vpUt+mVzGYXCwSvkdwMCpPoPH9asYXSEWLoDOIagNUbuUQ5Y/A1iKWpM8p
21IND9tI+UiXMBgrDpeR/0b/E+Waswfb9qdXDSBDFGdB1aJo/f9KsikHNwxYczxh
YF0Ra3WqJC0n3+IEgoaCy/8Shon6VDsnZtB0aMXBIUEd+tpx0CBggLmHWL7jwcwy
CRD2bYzuM3yvux/u7U0B5GmfDEmyuNoEyMuUGC1+Sk7TFBtW0I9LpBDY5m5hPl1y
VeATJx0vPbmcy/smzkVKYTwhFWF/AYT4CrNbrTYkkb39JmWHTH6GU1KEfoonTbA7
oAUG6cFvFA==
_______________________________________________________________________________
]]></programlisting>
</example>
</refsect1>
<refsect1 id="seealso_smime_encrypt"><title>See Also</title>
<para><link linkend="fn_smime_decrypt">smime_decrypt</link></para>
<para><link linkend="fn_smime_sign">smime_sign</link></para>
<para><link linkend="fn_smime_verify">smime_verify</link></para>
<para><link linkend="fn_pem_certificates_to_array">pem_certificates_to_array</link></para>
</refsect1>
</refentry>
|