curl-library
Re: curl and PGP/GPG
Date: Fri, 25 May 2018 17:32:12 +0200
On 05/25/2018 02:53 PM, Alain Reymond wrote:
> Hello,
Hi Alain,
> is there a way to use cURL to send emails encrypted with GPG ?
Yes, providing you handle the encryption yourself and feed curl with the
already encrypted data. There's no data encryption support built in
libcurl and you have to use some external logic/libraries to format and
encrypt your data.
> I would like to send emails to people having a pgp key. The email is
> composed of a text + html body and attached files (pdf or doc).
> A C program receives the different elements (from, to, subject, body
> text, body html, and list of attachments) and uses curl_formadd to
> prepare the mail which is later sent via an html service.
So you don't want to send an SMTP mail ! What you describe is actually
an HTML form submission.
The actual data formatting is thus dependent of what your HTTP server
expects and how it combines the input data to create the RFC822 mail.
As a hint, you can read RFC 3156, as long as the data expected by your
HTTP server can be compatible with this standard.
You can use the mime api rather than the formadd api (which is
deprecated) to fill-in the form fields. See
https://curl.haxx.se/libcurl/c/curl_mime_init.html.
> My question is : how can I encrypt the email using pgp ?
Maybe have a look at https://www.gnupg.org/related_software/gpgme/
Patrick
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-05-25