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

NAME

6       CURLOPT_SSH_KEYDATA - pointer passed to the SSH key callback
7

SYNOPSIS

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

DESCRIPTION

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

DEFAULT

18       NULL
19

PROTOCOLS

21       SFTP and SCP
22

EXAMPLE

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

AVAILABILITY

44       Added in 7.19.6
45

RETURN VALUE

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

SEE ALSO

51       CURLOPT_SSH_KEYDATA(3), CURLOPT_SSH_KNOWNHOSTS(3),
52
53
54
55libcurl 7.85.0                   May 17, 2022           CURLOPT_SSH_KEYDATA(3)
Impressum