1
.\" Copyright (C) The libssh2 project and its contributors.
2
.\" SPDX-License-Identifier: BSD-3-Clause
3
.TH libssh2_sign_sk 3 "1 Jun 2022" "libssh2 1.10.0" "libssh2"
5
libssh2_sign_sk - Create a signature from a FIDO2 authenticator.
11
libssh2_sign_sk(LIBSSH2_SESSION *session,
14
const unsigned char *data,
18
typedef struct _LIBSSH2_PRIVKEY_SK {
21
const char *application;
22
const unsigned char *key_handle;
24
LIBSSH2_USERAUTH_SK_SIGN_FUNC((*sign_callback));
29
\fIsession\fP - Session instance as returned by
30
.BR libssh2_session_init_ex(3)
32
\fIsig\fP - A pointer to a buffer in which to place the signature. The caller
33
is responsible for freeing the signature with LIBSSH2_FREE.
35
\fIsig_len\fP - A pointer to the length of the sig parameter.
37
\fIdata\fP - The data to sign.
39
\fIdata_len\fP - The length of the data parameter.
41
\fIabstract\fP - A pointer to a pointer to a LIBSSH2_PRIVKEY_SK. See
44
Create a signature from a FIDO2 authenticator, using either the
45
sk-ssh-ed25519@openssh.com or sk-ecdsa-sha2-nistp256@openssh.com key
48
The abstract parameter is a pointer to a pointer due to the internal workings
49
of libssh2. The LIBSSH2_PRIVKEY_SK must be completely filled out, and the
50
caller is responsible for all memory management of its fields.
52
\fIalgorithm\fP - The signing algorithm to use. Possible values are
53
LIBSSH2_HOSTKEY_TYPE_ED25519 and LIBSSH2_HOSTKEY_TYPE_ECDSA_256.
55
\fIflags\fP - A bitmask specifying options for the authenticator. When
56
LIBSSH2_SK_PRESENCE_REQUIRED is set, the authenticator requires a touch. When
57
LIBSSH2_SK_VERIFICATION_REQUIRED is set, the authenticator requires a PIN.
58
Many servers and authenticators do not work properly when
59
LIBSSH2_SK_PRESENCE_REQUIRED is not set.
61
\fIapplication\fP - A user-defined string to use as the RP name for the
62
authenticator. Usually "ssh:".
64
\fIkey_handle\fP - The key handle to use for the authenticator's allow list.
66
\fIhandle_len\fP - The length of the key_handle parameter.
68
\fIabstract\fP - User-defined data. When a PIN is required, use this to pass in
69
the PIN, or a function pointer to retrieve the PIN.
71
\fIkey_handle\fP The decoded key handle from the private key file.
73
\fIhandle_len\fP The length of the key_handle parameter.
75
\fIsign_callback\fP - Responsible for communicating with the hardware
76
authenticator to generate a signature. On success, the signature information
77
must be placed in the `\fIsig_info\fP sig_info parameter and the callback must
78
return 0. On failure, it should return a negative number. See
79
.BR libssh2_userauth_publickey_sk(3)
82
\fIorig_abstract\fP - User-defined data. When a PIN is required, use this to
83
pass in the PIN, or a function pointer to retrieve the PIN.
85
Return 0 on success or negative on failure.
87
.BR libssh2_userauth_publickey_sk(3)