1CURLOPT_SSH_KEYDATA(3)     curl_easy_setopt options     CURLOPT_SSH_KEYDATA(3)
2
3
4

NAME

6       CURLOPT_SSH_KEYDATA - pointer to pass to the SSH key callback
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode   curl_easy_setopt(CURL   *handle,  CURLOPT_SSH_KEYDATA,  void
12       *pointer);
13

DESCRIPTION

15       Pass a void * as parameter. This pointer will be passed along  verbatim
16       to the callback set with CURLOPT_SSH_KEYFUNCTION(3).
17

DEFAULT

19       NULL
20

PROTOCOLS

22       SFTP and SCP
23

EXAMPLE

25       static int keycb(CURL *easy,
26                        const struct curl_khkey *knownkey,
27                        const struct curl_khkey *foundkey,
28                        enum curl_khmatch,
29                        void *clientp)
30       {
31         /* 'clientp' points to the callback_data struct */
32         /* investigate the situation and return the correct value */
33         return CURLKHSTAT_FINE_ADD_TO_FILE;
34       }
35       {
36         curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/thisfile.txt");
37         curl_easy_setopt(curl, CURLOPT_SSH_KEYFUNCTION, keycb);
38         curl_easy_setopt(curl, CURLOPT_SSH_KEYDATA, &callback_data);
39         curl_easy_setopt(curl, CURLOPT_SSH_KNOWNHOSTS, "/home/user/known_hosts");
40
41         curl_easy_perform(curl);
42       }
43

AVAILABILITY

45       Added in 7.19.6
46

RETURN VALUE

48       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
49       if not.
50

SEE ALSO

52       CURLOPT_SSH_KEYDATA(3), CURLOPT_SSH_KNOWNHOSTS(3),
53
54
55
56libcurl 7.79.1                 November 04, 2020        CURLOPT_SSH_KEYDATA(3)
Impressum