assh/helper_key.h header reference

Description  

This header file provides helper functions designed to load and store SSH keys on disk.

See also Key types and formats and assh/assh_key.h.

Members  

Type  

Functions  

  • assh_status_t asshh_hostkey_load_file(assh_context_s *c, const char *key_algo, assh_algo_class_e role, FILE *file, assh_key_format_e format, size_t size_hint)
  • assh_status_t asshh_hostkey_load_filename(assh_context_s *c, const char *key_algo, assh_algo_class_e role, const char *filename, assh_key_format_e format, size_t size_hint)
  • assh_status_t asshh_key_create(assh_context_s *c, assh_key_s **key, size_t bits, const char *key_algo, assh_algo_class_e role)
  • assh_status_t asshh_key_fingerprint(assh_context_s *c, const assh_key_s *key, asshh_fingerprint_fmt_e fmt, char *buf, size_t *buf_size, const char **fmt_name)
  • assh_status_t asshh_key_load(assh_context_s *c, assh_key_s **key, const char *key_algo, assh_algo_class_e role, assh_key_format_e format, const uint8_t **blob, size_t blob_len)
  • assh_status_t asshh_key_load_file(assh_context_s *c, assh_key_s **head, const char *key_algo, assh_algo_class_e role, FILE *file, assh_key_format_e format, const char *passphrase, size_t size_hint)
  • assh_status_t asshh_key_load_filename(assh_context_s *c, assh_key_s **head, const char *key_algo, assh_algo_class_e role, const char *filename, assh_key_format_e format, const char *passphrase, size_t size_hint)
  • assh_status_t asshh_key_save_file(assh_context_s *c, const assh_key_s *head, FILE *file, assh_key_format_e format, const char *passphrase)
  • assh_status_t asshh_key_save_filename(assh_context_s *c, const assh_key_s *head, const char *filename, assh_key_format_e format, const char *passphrase)

Members detail  

enum asshh_fingerprint_fmt_e  

This enum is declared in assh/helper_key.h source file, line 137.

This enum specifies formats of ssh key fingerprint.

IdentifierDescription
ASSH_FP_RFC4716_MD5
ASSH_FP_RFC4255_SHA1
ASSH_FP_RFC6594_SHA256
ASSH_FP_BASE64_SHA256

assh_status_t asshh_hostkey_load_file(assh_context_s *c, const char *key_algo, assh_algo_class_e role, FILE *file, assh_key_format_e format, size_t size_hint)  

This function is declared in assh/helper_key.h source file, line 109.

This function loads a key from a file handler and register the key on the library context.

See also asshh_key_load_file.

assh_status_t asshh_hostkey_load_filename(assh_context_s *c, const char *key_algo, assh_algo_class_e role, const char *filename, assh_key_format_e format, size_t size_hint)  

This function is declared in assh/helper_key.h source file, line 118.

This function loads a key from a file name and register the key on the library context.

See also asshh_key_load_filename.

assh_status_t asshh_key_create(assh_context_s *c, assh_key_s **key, size_t bits, const char *key_algo, assh_algo_class_e role)  

This function is declared in assh/helper_key.h source file, line 59.

Preprocessor condition: defined( CONFIG_ASSH_KEY_CREATE )

This function lookup the key algorithm name and calls the assh_key_create function.

assh_status_t asshh_key_fingerprint(assh_context_s *c, const assh_key_s *key, asshh_fingerprint_fmt_e fmt, char *buf, size_t *buf_size, const char **fmt_name)  

This function is declared in assh/helper_key.h source file, line 156.

This function writes a fingerprint string of a key in the provided buffer. The value of buf_size is updated with the required size when a NULL buffer is passed. The string is null terminated.

The function returns ASSH_NO_DATA when the format is not known. All supported format ids are contiguous, starting at 0.

assh_status_t asshh_key_load(assh_context_s *c, assh_key_s **key, const char *key_algo, assh_algo_class_e role, assh_key_format_e format, const uint8_t **blob, size_t blob_len)  

This function is declared in assh/helper_key.h source file, line 50.

This function lookup the key algorithm name and calls the assh_key_load function.

assh_status_t asshh_key_load_file(assh_context_s *c, assh_key_s **head, const char *key_algo, assh_algo_class_e role, FILE *file, assh_key_format_e format, const char *passphrase, size_t size_hint)  

This function is declared in assh/helper_key.h source file, line 88.

This function loads a key from a file handle and inserts the key in the head linked list. Both binary and text key formats are supported. This function relies on assh_key_load to load the binary key blob.

Depending on the format, the function may be able to guess the type of key when NULL is passed as algo parameter. When the type of key is not supported by a registered algorithm, the function fails but the position of the file handle is advanced.

When the ASSH_KEY_FMT_NONE format is specified, multiple supported formats are tried.

When a binary format is used, the size_hint argument specifies the amount of bytes that must be read from the file. When a text format is used, the size_hint argument only controls the allocation of the temporary buffer used to store the underlying binary format. In either cases, a large enough default value is used when 0 is passed.

assh_status_t asshh_key_load_filename(assh_context_s *c, assh_key_s **head, const char *key_algo, assh_algo_class_e role, const char *filename, assh_key_format_e format, const char *passphrase, size_t size_hint)  

This function is declared in assh/helper_key.h source file, line 100.

This function loads a key from a file name and inserts the key in a linked list. This function relies on asshh_key_load_file.

assh_status_t asshh_key_save_file(assh_context_s *c, const assh_key_s *head, FILE *file, assh_key_format_e format, const char *passphrase)  

This function is declared in assh/helper_key.h source file, line 125.

This function saves one or more keys to a file.

See also asshh_key_load_filename.

assh_status_t asshh_key_save_filename(assh_context_s *c, const assh_key_s *head, const char *filename, assh_key_format_e format, const char *passphrase)  

This function is declared in assh/helper_key.h source file, line 133.

This function saves one or more keys to a file.

See also asshh_key_save_file.

Valid XHTML 1.0 StrictGenerated by diaxen on Sun Sep 27 13:33:12 2020 using MkDoc