:orphan: .. index:: pair: group; Agent keys subtree .. _doxid-group__tapi__conf__key: Agent keys subtree ================== .. toctree:: :hidden: enum_tapi_cfg_key_manager.rst enum_tapi_cfg_key_mode.rst enum_tapi_cfg_key_size.rst enum_tapi_cfg_key_type.rst Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block // typedefs typedef enum :ref:`tapi_cfg_key_manager` :ref:`tapi_cfg_key_manager`; typedef enum :ref:`tapi_cfg_key_type` :ref:`tapi_cfg_key_type`; typedef enum :ref:`tapi_cfg_key_size` :ref:`tapi_cfg_key_size`; typedef enum :ref:`tapi_cfg_key_mode` :ref:`tapi_cfg_key_mode`; // enums enum :ref:`tapi_cfg_key_manager`; enum :ref:`tapi_cfg_key_mode`; enum :ref:`tapi_cfg_key_size`; enum :ref:`tapi_cfg_key_type`; // global functions bool :ref:`tapi_cfg_key_exists`(const char* ta, const char* key_name); :ref:`te_errno` :ref:`tapi_cfg_key_add`(const char* ta, const char* key_name, :ref:`tapi_cfg_key_manager` manager, :ref:`tapi_cfg_key_type` type, :ref:`tapi_cfg_key_size` size, :ref:`tapi_cfg_key_mode` mode); unsigned :ref:`tapi_cfg_key_get_bitsize`(const char* ta, const char* key_name); char* :ref:`tapi_cfg_key_get_private_key_path`(const char* ta, const char* key_name); char* :ref:`tapi_cfg_key_get_public_key`(const char* ta, const char* key_name); :ref:`te_errno` :ref:`tapi_cfg_key_del`(const char* ta, const char* key_name); :ref:`te_errno` :ref:`tapi_cfg_key_append_public`(const char* ta, const char* key_name, const char* dst_ta, const char* list_name); .. _details-group__tapi__conf__key: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Typedefs -------- .. index:: pair: typedef; tapi_cfg_key_manager .. _doxid-group__tapi__conf__key_1ga1d1e2e10380003039b1371f1a45fbd2f: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef enum :ref:`tapi_cfg_key_manager` tapi_cfg_key_manager Support key managers .. index:: pair: typedef; tapi_cfg_key_type .. _doxid-group__tapi__conf__key_1gaf2db738ba6a9e85b8952eb16a29ab7aa: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef enum :ref:`tapi_cfg_key_type` tapi_cfg_key_type Key types. Different key managers may have different sets of key types. .. index:: pair: typedef; tapi_cfg_key_size .. _doxid-group__tapi__conf__key_1ga2316f217efdf460dabd0c795067a364f: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef enum :ref:`tapi_cfg_key_size` tapi_cfg_key_size Key sizes. The values are abstract, not exact bit sizes, because different key type may have totally different semantics of a key size, therefore requesting a exact size rarely makes any sense .. index:: pair: typedef; tapi_cfg_key_mode .. _doxid-group__tapi__conf__key_1ga0c517659fd67cfa6c45a5703f7b6d619: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef enum :ref:`tapi_cfg_key_mode` tapi_cfg_key_mode Key replacement modes. If a key does not exist, it is always created. Global Functions ---------------- .. index:: pair: function; tapi_cfg_key_exists .. _doxid-group__tapi__conf__key_1ga12f6f144c83ec6899dc5254216d0f79d: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool tapi_cfg_key_exists(const char* ta, const char* key_name) Check whether a key exists .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ta - Agent name * - key_name - Key name .. rubric:: Returns: ``true`` if the key exists .. index:: pair: function; tapi_cfg_key_add .. _doxid-group__tapi__conf__key_1ga86d17425e522e97d4122dfa2f25bc478: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_cfg_key_add(const char* ta, const char* key_name, :ref:`tapi_cfg_key_manager` manager, :ref:`tapi_cfg_key_type` type, :ref:`tapi_cfg_key_size` size, :ref:`tapi_cfg_key_mode` mode) Add or replace a key with given parameters. Because keys may be generated by an external tool at the agent, there may not be simple diagnostics if something goes wrong there. An assortment of error codes may be returned, such as ``TE_ESHCMD``, ``TE_EIO`` and others. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ta - Agent name * - key_name - Key name * - manager - Key manager * - type - Key type * - size - Key size * - mode - Key replacement mode. If a key does not exist, it is always created in any mode. * - TE_EEXIST - New key has been requested, but a key already exists * - TE_EBADSLT - A key cannot be reused due to different parameters * - TE_TE_EPROTONOSUPPORT - The agent does not support a requested manager .. rubric:: Returns: Status code .. index:: pair: function; tapi_cfg_key_get_bitsize .. _doxid-group__tapi__conf__key_1gacf2050703ccdb1934364bebc66ffbf33: .. ref-code-block:: cpp :class: doxyrest-title-code-block unsigned tapi_cfg_key_get_bitsize(const char* ta, const char* key_name) Get the real bit size of a generated key. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ta - Agent name * - key_name - Key_name * - 0 - There is an error * - 1 - This may be returned instead of a real size for some key types which do not have a sensible notion of a key bit size .. rubric:: Returns: The real bit size of a key .. index:: pair: function; tapi_cfg_key_get_private_key_path .. _doxid-group__tapi__conf__key_1gad012b9e016fdf5f61a7461b16fa4482c: .. ref-code-block:: cpp :class: doxyrest-title-code-block char* tapi_cfg_key_get_private_key_path(const char* ta, const char* key_name) Get the private key file path at the agent side. The name shall not change if a key is re-generated. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ta - Agent name * - key_name - Key name * - NULL - An error happened .. rubric:: Returns: Private key path (should be free()'d) .. index:: pair: function; tapi_cfg_key_get_public_key .. _doxid-group__tapi__conf__key_1ga49d7f3364ef65852be7f2d54af2a48fd: .. ref-code-block:: cpp :class: doxyrest-title-code-block char* tapi_cfg_key_get_public_key(const char* ta, const char* key_name) Get the public key. This is the real encoded public key string, *not* a file name. The string is guaranteed not to have any embedded zeroes. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ta - Agent name * - key_name - Key name * - NULL - An error happened .. rubric:: Returns: Public key string (should be free()'d) .. index:: pair: function; tapi_cfg_key_del .. _doxid-group__tapi__conf__key_1gae3ffff6d753b6695215782837654b2b1: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_cfg_key_del(const char* ta, const char* key_name) Delete a key from the agent. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ta - Agent name * - key_name - Key name .. rubric:: Returns: Status code .. index:: pair: function; tapi_cfg_key_append_public .. _doxid-group__tapi__conf__key_1ga3b082834160313ba654aa1e5f284d545: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_cfg_key_append_public(const char* ta, const char* key_name, const char* dst_ta, const char* list_name) Append a public key to a list of keys. Append the public key of ``key_name`` from ``ta`` to a file ``list_name`` on ``dst_ta``. If the file does not exist, it is created. If ``list_name`` is relative, it is relative to ``/agent`` :dst_ta/tmp_dir .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ta - Source agent name * - key_name - Key name * - dst_ta - Destination agent name * - list_name - Key list file name .. rubric:: Returns: Status code