File indexing completed on 2025-01-17 09:55:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 #ifndef LIBSSH2_PUBLICKEY_H
0049 #define LIBSSH2_PUBLICKEY_H 1
0050
0051 #include "libssh2.h"
0052
0053 typedef struct _LIBSSH2_PUBLICKEY LIBSSH2_PUBLICKEY;
0054
0055 typedef struct _libssh2_publickey_attribute {
0056 const char *name;
0057 unsigned long name_len;
0058 const char *value;
0059 unsigned long value_len;
0060 char mandatory;
0061 } libssh2_publickey_attribute;
0062
0063 typedef struct _libssh2_publickey_list {
0064 unsigned char *packet;
0065
0066 const unsigned char *name;
0067 unsigned long name_len;
0068 const unsigned char *blob;
0069 unsigned long blob_len;
0070 unsigned long num_attrs;
0071 libssh2_publickey_attribute *attrs;
0072 } libssh2_publickey_list;
0073
0074
0075
0076 #define libssh2_publickey_attribute(name, value, mandatory) \
0077 { (name), strlen(name), (value), strlen(value), (mandatory) },
0078 #define libssh2_publickey_attribute_fast(name, value, mandatory) \
0079 { (name), sizeof(name) - 1, (value), sizeof(value) - 1, (mandatory) },
0080
0081 #ifdef __cplusplus
0082 extern "C" {
0083 #endif
0084
0085
0086 LIBSSH2_API LIBSSH2_PUBLICKEY *
0087 libssh2_publickey_init(LIBSSH2_SESSION *session);
0088
0089 LIBSSH2_API int
0090 libssh2_publickey_add_ex(LIBSSH2_PUBLICKEY *pkey,
0091 const unsigned char *name,
0092 unsigned long name_len,
0093 const unsigned char *blob,
0094 unsigned long blob_len, char overwrite,
0095 unsigned long num_attrs,
0096 const libssh2_publickey_attribute attrs[]);
0097 #define libssh2_publickey_add(pkey, name, blob, blob_len, overwrite, \
0098 num_attrs, attrs) \
0099 libssh2_publickey_add_ex((pkey), \
0100 (name), strlen(name), \
0101 (blob), (blob_len), \
0102 (overwrite), (num_attrs), (attrs))
0103
0104 LIBSSH2_API int libssh2_publickey_remove_ex(LIBSSH2_PUBLICKEY *pkey,
0105 const unsigned char *name,
0106 unsigned long name_len,
0107 const unsigned char *blob,
0108 unsigned long blob_len);
0109 #define libssh2_publickey_remove(pkey, name, blob, blob_len) \
0110 libssh2_publickey_remove_ex((pkey), \
0111 (name), strlen(name), \
0112 (blob), (blob_len))
0113
0114 LIBSSH2_API int
0115 libssh2_publickey_list_fetch(LIBSSH2_PUBLICKEY *pkey,
0116 unsigned long *num_keys,
0117 libssh2_publickey_list **pkey_list);
0118 LIBSSH2_API void
0119 libssh2_publickey_list_free(LIBSSH2_PUBLICKEY *pkey,
0120 libssh2_publickey_list *pkey_list);
0121
0122 LIBSSH2_API int libssh2_publickey_shutdown(LIBSSH2_PUBLICKEY *pkey);
0123
0124 #ifdef __cplusplus
0125 }
0126 #endif
0127
0128 #endif