1libssh2_userauth_publickey_frommemoryl(i3bl)sisbhs2sh2_userauth_publickey_frommemory(3)
2
3
4

NAME

6       libssh2_userauth_publickey_frommemory  -  authenticate a session with a
7       public key, read from memory
8

SYNOPSIS

10       #include <libssh2.h>
11
12       int
13       libssh2_userauth_publickey_frommemory(LIBSSH2_SESSION *session,
14                                             const char *username,
15                                             size_t username_len,
16                                             const char *publickeydata,
17                                             size_t publickeydata_len,
18                                             const char *privatekeydata,
19                                             size_t privatekeydata_len,
20                                             const char *passphrase);
21

DESCRIPTION

23       This function allows to authenticate a session with a public  key  read
24       from  memory.   It is only supported when libssh2 is backed by OpenSSL.
25       session - Session instance as returned by libssh2_session_init_ex(3)
26
27       username - Remote user name to authenticate as.
28
29       username_len - Length of username.
30
31       publickeydata - Buffer containing the contents of a public key file.
32
33       publickeydata_len - Length of public key data.
34
35       privatekeydata - Buffer containing the contents of a private key file.
36
37       privatekeydata_len - Length of private key data.
38
39       passphrase - Passphrase to use when decoding private key file.
40
41       Attempt public key authentication using a PEM encoded private key  file
42       stored in memory.
43

RETURN VALUE

45       Return  0  on  success  or negative on failure.  It returns LIBSSH2_ER‐
46       ROR_EAGAIN when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is
47       a negative number, it is not really a failure per se.
48

ERRORS

50       LIBSSH2_ERROR_ALLOC -  An internal memory allocation call failed.
51
52       LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
53
54       LIBSSH2_ERROR_SOCKET_TIMEOUT -
55
56       LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED  -  The username/public key combina‐
57       tion was invalid.
58
59       LIBSSH2_ERROR_AUTHENTICATION_FAILED - Authentication using the supplied
60       public key was not accepted.
61

AVAILABILITY

63       libssh2_userauth_publickey_frommemory was added in libssh2 1.6.0
64

SEE ALSO

66       libssh2_session_init_ex(3)
67
68
69
70libssh2                           1 Sepli2b0s1s4h2_userauth_publickey_frommemory(3)
Impressum