1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-10-24 14:53:03 +03:00
Files
libssh2/docs/libssh2_agent_sign.md
Viktor Szakats b889b39945 docs: convert man page sources to "curldown" format
To render in Git webviews as-is, to make it easier to edit, verify,
and to sync up with curl.

- add options to not build the `.3` man pages:
  - autotools: `--disable-docs`
  - cmake: `LIBSSH2_BUILD_DOCS=OFF`
- building `.3` man pages requires Perl after this patch.
- drop `mansyntax` and the shell / `grep` / GNU `man` tool requirements with it.
- scripts and most logic were copied from curl.
- add `cd2nroff` from curl, with edits to relax curl-specific checks.
- used `nroff2cd` (from curl) to convert from `.3` to `.md`. Then
  manually fixed copyrights, inline function references and a couple
  of other things.

Credits-to: Daniel Stenberg

Ref: eefcc1bda4
Ref: https://github.com/curl/curl/pull/12730
Ref: https://github.com/libssh2/www/issues/25#issuecomment-3289431671

Closes #1660
2025-10-09 04:05:38 +02:00

1.8 KiB

c, SPDX-License-Identifier, Title, Section, Source, See-also
c SPDX-License-Identifier Title Section Source See-also
Copyright (C) The libssh2 project and its contributors. BSD-3-Clause libssh2_agent_sign 3 libssh2
libssh2_agent_get_identity(3)
libssh2_agent_init(3)
libssh2_agent_userauth(3)
libssh2_session_callback_set2(3)

NAME

libssh2_agent_sign - sign data, with the help of ssh-agent

SYNOPSIS

#include <libssh2.h>

int
libssh2_agent_sign(LIBSSH2_AGENT *agent,
                   struct libssh2_agent_publickey *identity,
                   unsigned char **sig,
                   size_t *s_len,
                   const unsigned char *data,
                   size_t d_len,
                   const char *method,
                   unsigned int method_len);

DESCRIPTION

agent - ssh-agent handle as returned by libssh2_agent_init(3).

identity - Public key to authenticate with, as returned by libssh2_agent_get_identity(3)

sig - A pointer to a buffer in which to place the signature. The caller is responsible for freeing the signature with LIBSSH2_FREE.

s_len - A pointer to the length of the sig parameter.

data - The data to sign.

d_len - The length of the data parameter.

method - A buffer indicating the signing method. This should match the string at the start of identity->blob.

method_len - The length of the method parameter.

Sign data using an ssh-agent. This function can be used in a callback registered with libssh2_session_callback_set2(3) using LIBSSH2_CALLBACK_AUTHAGENT_SIGN to sign an authentication challenge from a server. However, the client is responsible for implementing the code that calls this callback in response to a SSH2_AGENTC_SIGN_REQUEST message.

RETURN VALUE

Returns 0 if succeeded, or a negative value for error.

AVAILABILITY

Added in libssh2 1.11.0