1libssh2_userauth_publickey_frommelmiobrsys(h32l)imbasnsuha2l_userauth_publickey_frommemory(3)
2
3
4
6 libssh2_userauth_publickey_frommemory - authenticate a session with a
7 public key, read from memory
8
10 #include <libssh2.h>
11
12 int libssh2_userauth_publickey_frommemory(LIBSSH2_SESSION *session,
13 const char *username,
14 size_t username_len,
15 const char *publickeydata,
16 size_t publickeydata_len,
17 const char *privatekeydata,
18 size_t privatekeydata_len,
19 const char *passphrase);
20
22 This function allows to authenticate a session with a public key read
23 from memory. It's only supported when libssh2 is backed by OpenSSL.
24 session - Session instance as returned by libssh2_session_init_ex(3)
25
26 username - Remote user name to authenticate as.
27
28 username_len - Length of username.
29
30 publickeydata - Buffer containing the contents of a public key file.
31
32 publickeydata_len - Length of public key data.
33
34 privatekeydata - Buffer containing the contents of a private key file.
35
36 privatekeydata_len - Length of private key data.
37
38 passphrase - Passphrase to use when decoding private key file.
39
40 Attempt public key authentication using a PEM encoded private key file
41 stored in memory.
42
44 Return 0 on success or negative on failure. It returns LIB‐
45 SSH2_ERROR_EAGAIN when it would otherwise block. While LIB‐
46 SSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per
47 se.
48
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
63 libssh2_userauth_publickey_frommemory was added in libssh2 1.6.0
64
66 libssh2_session_init_ex(3)
67
68
69
70libssh2 1.5 1 Sepli2b0s1s4h2_userauth_publickey_frommemory(3)