cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Base64 encode and decode

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 24 Jan 2011 16:25:25 -0800

On Mon, Jan 24, 2011 at 06:49:30PM -0500, amit paliwal wrote:
> On Fri, Jan 21, 2011 at 2:16 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Fri, 21 Jan 2011, amit paliwal wrote:
> On some earlier date, Dan Fandrich wrote this unattributed paragraph:
> libcurl base64-encodes control data in a few places automatically
> when required (e.g. for Basic authentication), but it won't encode
> data. If your application requires base64-encoded data, it will
> need to be so encoded in the app.  And those two functions are not
> actually part of the libcurl API, so they aren't even available for
> use in apps, anyway.
>
> So does it mean that if I use TLS and HTTPS I need not to apply it
> separately and it will be done automatically??????
>
> It means that libcurl provides an API to do data transfers. You can use
> that API as documented. libcurl offers transfers using a larger amount of
> different protocols, and some of those protocols do sometimes require that
> data is sent base64-encoded and then libcurl will do so.
>
> I tried using curl_base64.h, but when i installed the curl package, i did not
> found this .h file in my /usr/local/include/curl  directory where other .h
> files like curl.h are present. Do i need to enable it with some particular
> option.

I'm quoting the whole message, because the answer is contained in your own
e-mail, namely:

        And those two functions are not actually part of the libcurl API, so
        they aren't even available for use in apps, anyway.

That means you'll have to reimplement them yourself, or copy the source out of
libcurl. libcurl has a family of curlx_* functions that fall into this sort
of category of useful, but not really appropriate to have in the libcurl API,
but the base64 functions aren't included in these.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-01-25