libgit2

git_cred_ssh_custom_new

Version:

Create an ssh key credential with a custom signing function.

This lets you use your own function to sign the challenge.

This function and its credential type is provided for completeness and wraps libssh2_userauth_publickey(), which is undocumented.

The supplied credential parameter will be internally duplicated.

Signature

int git_cred_ssh_custom_new(git_cred **out, const char *username, const char *publickey, size_t publickey_len, git_cred_sign_callback sign_callback, void *payload);

Parameters

In
out

The newly created credential object.

const char *
In
username

username to use to authenticate

const char *
In
publickey

The bytes of the public key.

size_t
In
publickey_len

The length of the public key in bytes.

In
sign_callback

The callback method to sign the data during the challenge.

void *
In
payload

Additional data to pass to the callback.

Returns

int

0 for success or an error code for failure

Versions