diff --git a/src/server_config.h b/src/server_config.h
index e3a8544..e38c086 100644
--- a/src/server_config.h
+++ b/src/server_config.h
@@ -20,7 +20,6 @@
 extern "C" {
 #endif
 
-#include <stdarg.h>
 #include <stdint.h>
 
 #include <libyang/libyang.h>
@@ -71,7 +70,7 @@
  * Context must already have implemented the required modules, see ::nc_server_config_load_modules().
  *
  * @param[in] diff YANG diff belonging to either ietf-netconf-server, ietf-keystore or ietf-truststore modules.
- * This diff should be validated. The top level node HAS to have an operation (create, replace, delete or none).
+ * The top level node HAS to have an operation (create, replace, delete or none).
  * @return 0 on success, 1 on error.
  */
 int nc_server_config_setup_diff(const struct lyd_node *diff);
@@ -84,7 +83,7 @@
  * Context must already have implemented the required modules, see ::nc_server_config_load_modules().
  *
  * @param[in] data YANG data belonging to either ietf-netconf-server, ietf-keystore or ietf-truststore modules.
- * This data should be validated. No node can have an operation attribute.
+ * This data __must be valid__. No node can have an operation attribute.
  * @return 0 on success, 1 on error.
  */
 int nc_server_config_setup_data(const struct lyd_node *data);
@@ -97,6 +96,7 @@
  *
  * @param[in] ctx libyang context.
  * @param[in] path Path to a file with ietf-netconf-server, ietf-keystore or ietf-truststore YANG data.
+ * This data __must be valid__. No node can have an operation attribute.
  * @return 0 on success, 1 on error.
  */
 int nc_server_config_setup_path(const struct ly_ctx *ctx, const char *path);
@@ -116,7 +116,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_address_port(const struct ly_ctx *ctx, const char *endpt_name, NC_TRANSPORT_IMPL transport,
+int nc_server_config_add_address_port(const struct ly_ctx *ctx, const char *endpt_name, NC_TRANSPORT_IMPL transport,
         const char *address, uint16_t port, struct lyd_node **config);
 
 #endif /* NC_ENABLED_SSH_TLS */
@@ -135,7 +135,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_unix_socket(const struct ly_ctx *ctx, const char *endpt_name, const char *path,
+int nc_server_config_add_unix_socket(const struct ly_ctx *ctx, const char *endpt_name, const char *path,
         mode_t mode, uid_t uid, gid_t gid, struct lyd_node **config);
 
 /**
@@ -146,7 +146,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_del_endpt(const char *endpt_name, struct lyd_node **config);
+int nc_server_config_del_endpt(const char *endpt_name, struct lyd_node **config);
 
 #ifdef NC_ENABLED_SSH_TLS
 
@@ -164,7 +164,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_keystore_asym_key(const struct ly_ctx *ctx, NC_TRANSPORT_IMPL ti, const char *asym_key_name,
+int nc_server_config_add_keystore_asym_key(const struct ly_ctx *ctx, NC_TRANSPORT_IMPL ti, const char *asym_key_name,
         const char *privkey_path, const char *pubkey_path, struct lyd_node **config);
 
 /**
@@ -175,7 +175,7 @@
  * @param[in,out] config Configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_del_keystore_asym_key(const char *asym_key_name, struct lyd_node **config);
+int nc_server_config_del_keystore_asym_key(const char *asym_key_name, struct lyd_node **config);
 
 /**
  * @brief Creates new YANG data nodes for a certificate in the keystore.
@@ -193,7 +193,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_keystore_cert(const struct ly_ctx *ctx, const char *asym_key_name, const char *cert_name,
+int nc_server_config_add_keystore_cert(const struct ly_ctx *ctx, const char *asym_key_name, const char *cert_name,
         const char *cert_path, struct lyd_node **config);
 
 /**
@@ -206,12 +206,13 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_del_keystore_cert(const char *asym_key_name, const char *cert_name, struct lyd_node **config);
+int nc_server_config_del_keystore_cert(const char *asym_key_name, const char *cert_name, struct lyd_node **config);
 
 /**
  * @brief Creates new YANG data nodes for a public key in the truststore.
  *
  * @param[in] ctx libyang context.
+ * @param[in] ti Transport for which this key will be used, to be generated correctly.
  * @param[in] pub_bag_name Arbitrary identifier of the public key bag.
  * This name is used to reference the public keys in the bag.
  * If a public key bag with this name already exists, its contents will be changed.
@@ -222,8 +223,8 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_truststore_pubkey(const struct ly_ctx *ctx, const char *pub_bag_name, const char *pubkey_name,
-        const char *pubkey_path, struct lyd_node **config);
+int nc_server_config_add_truststore_pubkey(const struct ly_ctx *ctx, NC_TRANSPORT_IMPL ti,
+        const char *pub_bag_name, const char *pubkey_name, const char *pubkey_path, struct lyd_node **config);
 
 /**
  * @brief Deletes a truststore's public key from the YANG data.
@@ -234,7 +235,7 @@
  * @param[in,out] config Configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_del_truststore_pubkey(const char *pub_bag_name, const char *pubkey_name, struct lyd_node **config);
+int nc_server_config_del_truststore_pubkey(const char *pub_bag_name, const char *pubkey_name, struct lyd_node **config);
 
 /**
  * @brief Creates new YANG data nodes for a certificate in the truststore.
@@ -250,7 +251,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_truststore_cert(const struct ly_ctx *ctx, const char *cert_bag_name, const char *cert_name,
+int nc_server_config_add_truststore_cert(const struct ly_ctx *ctx, const char *cert_bag_name, const char *cert_name,
         const char *cert_path, struct lyd_node **config);
 
 /**
@@ -262,7 +263,7 @@
  * @param[in,out] config Configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_del_truststore_cert(const char *cert_bag_name,
+int nc_server_config_del_truststore_cert(const char *cert_bag_name,
         const char *cert_name, struct lyd_node **config);
 
 /**
@@ -293,7 +294,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ssh_hostkey(const struct ly_ctx *ctx, const char *endpt_name, const char *hostkey_name,
+int nc_server_config_add_ssh_hostkey(const struct ly_ctx *ctx, const char *endpt_name, const char *hostkey_name,
         const char *privkey_path, const char *pubkey_path, struct lyd_node **config);
 
 /**
@@ -306,39 +307,10 @@
  * @param[in,out] config Configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ssh_del_hostkey(const struct ly_ctx *ctx, const char *endpt_name,
+int nc_server_config_del_ssh_hostkey(const struct ly_ctx *ctx, const char *endpt_name,
         const char *hostkey_name, struct lyd_node **config);
 
 /**
- * @brief Creates new YANG data nodes for a reference to an asymmetric key located in the keystore.
- *
- * This asymmetric key pair will be used as the SSH hostkey.
- *
- * @param[in] ctx libyang context.
- * @param[in] endpt_name Arbitrary identifier of an endpoint.
- * If an endpoint with this identifier already exists, its contents will be changed.
- * @param[in] hostkey_name Arbitrary identifier of the endpoint's hostkey.
- * If an endpoint's hostkey with this identifier already exists, its contents will be changed.
- * @param[in] keystore_reference Name of the asymmetric key pair to be referenced and used as a hostkey.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ssh_keystore_ref(const struct ly_ctx *ctx, const char *endpt_name, const char *hostkey_name,
-        const char *keystore_reference, struct lyd_node **config);
-
-/**
- * @brief Deletes a keystore reference from the YANG data.
- *
- * @param[in] endpt_name Identifier of an existing endpoint.
- * @param[in] hostkey_name Identifier of an existing hostkey on the given endpoint.
- * @param[in,out] config Configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ssh_del_keystore_ref(const char *endpt_name, const char *hostkey_name,
-        struct lyd_node **config);
-
-/**
  * @brief Creates new YANG configuration data nodes for the maximum amount of failed SSH authentication attempts.
  *
  * @param[in] ctx libyang context.
@@ -350,7 +322,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ssh_auth_attempts(const struct ly_ctx *ctx, const char *endpt_name, uint16_t auth_attempts,
+int nc_server_config_add_ssh_auth_attempts(const struct ly_ctx *ctx, const char *endpt_name, uint16_t auth_attempts,
         struct lyd_node **config);
 
 /**
@@ -365,7 +337,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ssh_auth_timeout(const struct ly_ctx *ctx, const char *endpt_name, uint16_t auth_timeout,
+int nc_server_config_add_ssh_auth_timeout(const struct ly_ctx *ctx, const char *endpt_name, uint16_t auth_timeout,
         struct lyd_node **config);
 
 /**
@@ -383,7 +355,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ssh_user_pubkey(const struct ly_ctx *ctx, const char *endpt_name,
+int nc_server_config_add_ssh_user_pubkey(const struct ly_ctx *ctx, const char *endpt_name,
         const char *user_name, const char *pubkey_name, const char *pubkey_path, struct lyd_node **config);
 
 /**
@@ -396,7 +368,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ssh_del_user_pubkey(const char *endpt_name, const char *user_name,
+int nc_server_config_del_ssh_user_pubkey(const char *endpt_name, const char *user_name,
         const char *pubkey_name, struct lyd_node **config);
 
 /**
@@ -412,7 +384,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ssh_user_password(const struct ly_ctx *ctx, const char *endpt_name,
+int nc_server_config_add_ssh_user_password(const struct ly_ctx *ctx, const char *endpt_name,
         const char *user_name, const char *password, struct lyd_node **config);
 
 /**
@@ -423,33 +395,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ssh_del_user_password(const char *endpt_name, const char *user_name,
-        struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for an SSH user's none authentication method.
- *
- * @param[in] ctx libyang context.
- * @param[in] endpt_name Arbitrary identifier of the endpoint.
- * If an endpoint with this identifier already exists, its user might be changed.
- * @param[in] user_name Arbitrary identifier of the user.
- * If an user with this identifier already exists, its contents will be changed.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ssh_user_none(const struct ly_ctx *ctx, const char *endpt_name,
-        const char *user_name, struct lyd_node **config);
-
-/**
- * @brief Deletes an SSH user's none authentication method from the YANG data.
- *
- * @param[in] endpt_name Identifier of an existing endpoint.
- * @param[in] user_name Identifier of an existing user on the given endpoint.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ssh_del_user_none(const char *endpt_name, const char *user_name,
+int nc_server_config_del_ssh_user_password(const char *endpt_name, const char *user_name,
         struct lyd_node **config);
 
 /**
@@ -468,7 +414,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ssh_user_interactive(const struct ly_ctx *ctx, const char *endpt_name,
+int nc_server_config_add_ssh_user_interactive(const struct ly_ctx *ctx, const char *endpt_name,
         const char *user_name, const char *pam_config_name, const char *pam_config_dir, struct lyd_node **config);
 
 /**
@@ -479,7 +425,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ssh_del_user_interactive(const char *endpt_name, const char *user_name,
+int nc_server_config_del_ssh_user_interactive(const char *endpt_name, const char *user_name,
         struct lyd_node **config);
 
 /**
@@ -491,39 +437,10 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ssh_del_user(const char *endpt_name,
+int nc_server_config_del_ssh_user(const char *endpt_name,
         const char *user_name, struct lyd_node **config);
 
 /**
- * @brief Creates new YANG data nodes for a reference to a public key bag located in the truststore.
- *
- * The public key's located in the bag will be used for client authentication.
- *
- * @param[in] ctx libyang context.
- * @param[in] endpt_name Arbitrary identifier of an endpoint.
- * If an endpoint with this identifier already exists, its contents will be changed.
- * @param[in] user_name Arbitrary identifier of the endpoint's user.
- * If an endpoint's user with this identifier already exists, its contents will be changed.
- * @param[in] truststore_reference Name of the public key bag to be referenced and used for authentication.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ssh_truststore_ref(const struct ly_ctx *ctx, const char *endpt_name, const char *user_name,
-        const char *truststore_reference, struct lyd_node **config);
-
-/**
- * @brief Deletes a truststore reference from the YANG data.
- *
- * @param[in] endpt_name Identifier of an existing endpoint.
- * @param[in] user_name Identifier of an user on the given endpoint whose truststore reference will be deleted.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ssh_del_truststore_ref(const char *endpt_name, const char *user_name,
-        struct lyd_node **config);
-
-/**
  * @brief Creates new YANG configuration data nodes, which will be a reference to another SSH endpoint's users.
  *
  * Whenever a client tries to connect to the referencing endpoint, all of its users will be tried first. If no match is
@@ -538,7 +455,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_config_new_ssh_endpoint_user_ref(const struct ly_ctx *ctx, const char *endpt_name,
+int nc_server_config_add_ssh_endpoint_client_ref(const struct ly_ctx *ctx, const char *endpt_name,
         const char *referenced_endpt, struct lyd_node **config);
 
 /**
@@ -548,123 +465,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_config_new_ssh_del_endpoint_user_ref(const char *endpt_name, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for host-key algorithms replacing any previous ones.
- *
- * Supported algorithms are: ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521,
- * rsa-sha2-512, rsa-sha2-256, ssh-rsa and ssh-dss.
- *
- * @param[in] ctx libyang context
- * @param[in] endpt_name Arbitrary identifier of the endpoint.
- * If an endpoint with this identifier already exists, its host-key algorithms will be replaced.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @param[in] alg_count Number of following algorithms.
- * @param[in] ... String literals of host-key algorithms in a decreasing order of preference.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ssh_host_key_algs(const struct ly_ctx *ctx, const char *endpt_name,
-        struct lyd_node **config, int alg_count, ...);
-
-/**
- * @brief Deletes a hostkey algorithm from the YANG data.
- *
- * @param[in] endpt_name Identifier of an existing endpoint.
- * @param[in] alg Optional algorithm to be deleted.
- * If NULL, all of the hostkey algorithms on this endpoint will be deleted.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ssh_del_host_key_alg(const char *endpt_name, const char *alg, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for key exchange algorithms replacing any previous ones.
- *
- * Supported algorithms are: diffie-hellman-group-exchange-sha1, curve25519-sha256, ecdh-sha2-nistp256,
- * ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group18-sha512, diffie-hellman-group16-sha512,
- * diffie-hellman-group-exchange-sha256 and diffie-hellman-group14-sha256.
- *
- * @param[in] ctx libyang context
- * @param[in] endpt_name Arbitrary identifier of the endpoint.
- * If an endpoint with this identifier already exists, its key exchange algorithms will be replaced.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @param[in] alg_count Number of following algorithms.
- * @param[in] ... String literals of key exchange algorithms in a decreasing order of preference.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ssh_key_exchange_algs(const struct ly_ctx *ctx, const char *endpt_name, struct lyd_node **config,
-        int alg_count, ...);
-
-/**
- * @brief Deletes a key exchange algorithm from the YANG data.
- *
- * @param[in] endpt_name Identifier of an existing endpoint.
- * @param[in] alg Optional algorithm to be deleted.
- * If NULL, all of the key exchange algorithms on this endpoint will be deleted.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ssh_del_key_exchange_alg(const char *endpt_name, const char *alg, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for encryption algorithms replacing any previous ones.
- *
- * Supported algorithms are: aes256-ctr, aes192-ctr, aes128-ctr, aes256-cbc, aes192-cbc, aes128-cbc, blowfish-cbc
- * triple-des-cbc and none.
- *
- * @param[in] ctx libyang context
- * @param[in] endpt_name Arbitrary identifier of the endpoint.
- * If an endpoint with this identifier already exists, its encryption algorithms will be replaced.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @param[in] alg_count Number of following algorithms.
- * @param[in] ... String literals of encryption algorithms in a decreasing order of preference.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ssh_encryption_algs(const struct ly_ctx *ctx, const char *endpt_name, struct lyd_node **config,
-        int alg_count, ...);
-
-/**
- * @brief Deletes an encryption algorithm from the YANG data.
- *
- * @param[in] endpt_name Identifier of an existing endpoint.
- * @param[in] alg Optional algorithm to be deleted.
- * If NULL, all of the encryption algorithms on this endpoint will be deleted.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ssh_del_encryption_alg(const char *endpt_name, const char *alg, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for mac algorithms replacing any previous ones.
- *
- * Supported algorithms are: hmac-sha2-256, hmac-sha2-512 and hmac-sha1.
- *
- * @param[in] ctx libyang context
- * @param[in] endpt_name Arbitrary identifier of the endpoint.
- * If an endpoint with this identifier already exists, its mac algorithms will be replaced.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @param[in] alg_count Number of following algorithms.
- * @param[in] ... String literals of mac algorithms in a decreasing order of preference.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ssh_mac_algs(const struct ly_ctx *ctx, const char *endpt_name, struct lyd_node **config,
-        int alg_count, ...);
-
-/**
- * @brief Deletes a mac algorithm from the YANG data.
- *
- * @param[in] endpt_name Identifier of an existing endpoint.
- * @param[in] alg Optional algorithm to be deleted.
- * If NULL, all of the mac algorithms on this endpoint will be deleted.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ssh_del_mac_alg(const char *endpt_name, const char *alg, struct lyd_node **config);
+int nc_server_config_del_ssh_endpoint_client_ref(const char *endpt_name, struct lyd_node **config);
 
 /**
  * @} SSH Server Configuration
@@ -692,7 +493,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_tls_server_certificate(const struct ly_ctx *ctx, const char *endpt_name, const char *privkey_path,
+int nc_server_config_add_tls_server_cert(const struct ly_ctx *ctx, const char *endpt_name, const char *privkey_path,
         const char *pubkey_path, const char *certificate_path, struct lyd_node **config);
 
 /**
@@ -702,31 +503,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_tls_del_server_certificate(const char *endpt_name, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for a keystore reference to the TLS server's certificate.
- *
- * @param[in] ctx libyang context.
- * @param[in] endpt_name Arbitrary identifier of the endpoint.
- * If an endpoint with this identifier already exists, its contents will be changed.
- * @param[in] asym_key_ref Name of the asymmetric key pair in the keystore to be referenced.
- * @param[in] cert_ref Name of the certificate, which must belong to the given asymmetric key pair, to be referenced.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_tls_keystore_ref(const struct ly_ctx *ctx, const char *endpt_name, const char *asym_key_ref,
-        const char *cert_ref, struct lyd_node **config);
-
-/**
- * @brief Deletes a TLS server certificate keystore reference from the YANG data.
- *
- * @param[in] endpt_name Identifier of an existing endpoint.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_tls_del_keystore_ref(const char *endpt_name, struct lyd_node **config);
+int nc_server_config_del_tls_server_cert(const char *endpt_name, struct lyd_node **config);
 
 /**
  * @brief Creates new YANG configuration data nodes for a client's (end-entity) certificate.
@@ -741,7 +518,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_tls_client_certificate(const struct ly_ctx *ctx, const char *endpt_name, const char *cert_name,
+int nc_server_config_add_tls_client_cert(const struct ly_ctx *ctx, const char *endpt_name, const char *cert_name,
         const char *cert_path, struct lyd_node **config);
 
 /**
@@ -753,30 +530,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_tls_del_client_certificate(const char *endpt_name, const char *cert_name, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for a truststore reference to a set of client (end-entity) certificates.
- *
- * @param[in] ctx libyang context.
- * @param[in] endpt_name Arbitrary identifier of the endpoint.
- * If an endpoint with this identifier already exists, its contents will be changed.
- * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_tls_client_cert_truststore_ref(const struct ly_ctx *ctx, const char *endpt_name,
-        const char *cert_bag_ref, struct lyd_node **config);
-
-/**
- * @brief Deletes a client (end-entity) certificates truststore reference from the YANG data.
- *
- * @param[in] endpt_name Identifier of an existing endpoint.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_tls_del_client_cert_truststore_ref(const char *endpt_name, struct lyd_node **config);
+int nc_server_config_del_tls_client_cert(const char *endpt_name, const char *cert_name, struct lyd_node **config);
 
 /**
  * @brief Creates new YANG configuration data nodes for a client certificate authority (trust-anchor) certificate.
@@ -791,7 +545,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_tls_client_ca(const struct ly_ctx *ctx, const char *endpt_name, const char *cert_name,
+int nc_server_config_add_tls_ca_cert(const struct ly_ctx *ctx, const char *endpt_name, const char *cert_name,
         const char *cert_path, struct lyd_node **config);
 
 /**
@@ -803,30 +557,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_tls_del_client_ca(const char *endpt_name, const char *cert_name, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for a truststore reference to a set of client certificate authority (trust-anchor) certificates.
- *
- * @param[in] ctx libyang context.
- * @param[in] endpt_name Arbitrary identifier of the endpoint.
- * If an endpoint with this identifier already exists, its contents will be changed.
- * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_tls_client_ca_truststore_ref(const struct ly_ctx *ctx, const char *endpt_name,
-        const char *cert_bag_ref, struct lyd_node **config);
-
-/**
- * @brief Deletes a client certificate authority (trust-anchor) certificates truststore reference from the YANG data.
- *
- * @param[in] endpt_name Identifier of an existing endpoint.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_tls_del_client_ca_truststore_ref(const char *endpt_name, struct lyd_node **config);
+int nc_server_config_del_tls_ca_cert(const char *endpt_name, const char *cert_name, struct lyd_node **config);
 
 /**
  * @brief Creates new YANG configuration data nodes, which will be a reference to another TLS endpoint's certificates.
@@ -843,7 +574,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_config_new_tls_endpoint_client_ref(const struct ly_ctx *ctx, const char *endpt_name,
+int nc_server_config_add_tls_endpoint_client_ref(const struct ly_ctx *ctx, const char *endpt_name,
         const char *referenced_endpt, struct lyd_node **config);
 
 /**
@@ -853,7 +584,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_config_new_tls_del_endpoint_client_ref(const char *endpt_name, struct lyd_node **config);
+int nc_server_config_del_tls_endpoint_client_ref(const char *endpt_name, struct lyd_node **config);
 
 /**
  * @brief Creates new YANG configuration data nodes for a cert-to-name entry.
@@ -870,7 +601,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_tls_ctn(const struct ly_ctx *ctx, const char *endpt_name, uint32_t id, const char *fingerprint,
+int nc_server_config_add_tls_ctn(const struct ly_ctx *ctx, const char *endpt_name, uint32_t id, const char *fingerprint,
         NC_TLS_CTN_MAPTYPE map_type, const char *name, struct lyd_node **config);
 
 /**
@@ -882,123 +613,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_tls_del_ctn(const char *endpt_name, uint32_t id, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for a TLS version.
- *
- * @param[in] ctx libyang context.
- * @param[in] endpt_name Arbitrary identifier of the endpoint.
- * If an endpoint with this identifier already exists, its contents will be changed.
- * @param[in] tls_version TLS version to be used. Call this multiple times to set
- * the accepted versions of the TLS protocol and let the client and server negotiate
- * the given version.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_tls_version(const struct ly_ctx *ctx, const char *endpt_name,
-        NC_TLS_VERSION tls_version, struct lyd_node **config);
-
-/**
- * @brief Deletes a TLS version from the YANG data.
- *
- * @param[in] endpt_name Identifier of an existing endpoint.
- * @param[in] tls_version TLS version to be deleted.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_tls_del_version(const char *endpt_name, NC_TLS_VERSION tls_version, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for a TLS cipher.
- *
- * @param[in] ctx libyang context.
- * @param[in] endpt_name Arbitrary identifier of the endpoint.
- * If an endpoint with this identifier already exists, its contents will be changed.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @param[in] cipher_count Number of following ciphers.
- * @param[in] ... TLS ciphers. These ciphers MUST be in the format as listed in the
- * iana-tls-cipher-suite-algs YANG model (lowercase and separated by dashes). Regardless
- * of the TLS protocol version used, all of these ciphers will be tried and some of them
- * might not be set (TLS handshake might fail then). For the list of supported ciphers see
- * the OpenSSL documentation.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_tls_ciphers(const struct ly_ctx *ctx, const char *endpt_name, struct lyd_node **config,
-        int cipher_count, ...);
-
-/**
- * @brief Deletes a TLS cipher from the YANG data.
- *
- * @param[in] endpt_name Identifier of an existing endpoint.
- * @param[in] cipher TLS cipher to be deleted.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_tls_del_cipher(const char *endpt_name, const char *cipher, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for a Certificate Revocation List via a local file.
- *
- * Beware that you can choose up to one function between the three CRL alternatives on a given endpoint and calling
- * this function will remove any CRL YANG nodes created by the other two functions.
- *
- * @param[in] ctx libyang context.
- * @param[in] endpt_name Arbitrary identifier of the endpoint.
- * If an endpoint with this identifier already exists, its contents will be changed.
- * @param[in] crl_path Path to a DER/PEM encoded CRL file.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_tls_crl_path(const struct ly_ctx *ctx, const char *endpt_name,
-        const char *crl_path, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for a Certificate Revocation List via an URL.
- *
- * Beware that you can choose up to one function between the three CRL alternatives on a given endpoint and calling
- * this function will remove any CRL YANG nodes created by the other two functions.
- *
- * @param[in] ctx libyang context.
- * @param[in] endpt_name Arbitrary identifier of the endpoint.
- * If an endpoint with this identifier already exists, its contents will be changed.
- * @param[in] crl_url URL from which the CRL file will be downloaded. The file has to be in the DER or PEM format.
- * The allowed protocols are all the protocols supported by CURL.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_tls_crl_url(const struct ly_ctx *ctx, const char *endpt_name, const char *crl_url, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for a Certificate Revocation List via certificate extensions.
- *
- * The chain of configured Certificate Authorities will be examined. For each certificate in this chain all the
- * CRLs from the URLs specified in their extension fields CRL Distribution Points will be downloaded and used.
- *
- * Beware that you can choose up to one function between the three CRL alternatives on a given endpoint and calling
- * this function will remove any CRL YANG nodes created by the other two functions.
- *
- * @param[in] ctx libyang context.
- * @param[in] endpt_name Arbitrary identifier of the endpoint.
- * If an endpoint with this identifier already exists, its contents will be changed.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_tls_crl_cert_ext(const struct ly_ctx *ctx, const char *endpt_name, struct lyd_node **config);
-
-/**
- * @brief Deletes all the CRL nodes from the YANG data.
- *
- * @param[in] endpt_name Identifier of an existing endpoint.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_tls_del_crl(const char *endpt_name, struct lyd_node **config);
+int nc_server_config_del_tls_ctn(const char *endpt_name, uint32_t id, struct lyd_node **config);
 
 /**
  * @} TLS Server Configuration
@@ -1039,7 +654,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_address_port(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
+int nc_server_config_add_ch_address_port(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
         NC_TRANSPORT_IMPL transport, const char *address, const char *port, struct lyd_node **config);
 
 #endif /* NC_ENABLED_SSH_TLS */
@@ -1052,7 +667,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_del_ch_client(const char *client_name, struct lyd_node **config);
+int nc_server_config_del_ch_client(const char *client_name, struct lyd_node **config);
 
 /**
  * @brief Deletes a Call Home endpoint from the YANG data.
@@ -1063,7 +678,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_del_endpt(const char *client_name, const char *endpt_name, struct lyd_node **config);
+int nc_server_config_del_ch_endpt(const char *client_name, const char *endpt_name, struct lyd_node **config);
 
 /**
  * @brief Creates new YANG configuration data nodes for the Call Home persistent connection type.
@@ -1077,7 +692,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_persistent(const struct ly_ctx *ctx, const char *client_name, struct lyd_node **config);
+int nc_server_config_add_ch_persistent(const struct ly_ctx *ctx, const char *client_name, struct lyd_node **config);
 
 /**
  * @brief Creates new YANG configuration data nodes for the period parameter of the Call Home periodic connection type.
@@ -1092,7 +707,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_period(const struct ly_ctx *ctx, const char *client_name, uint16_t period,
+int nc_server_config_add_ch_period(const struct ly_ctx *ctx, const char *client_name, uint16_t period,
         struct lyd_node **config);
 
 /**
@@ -1104,7 +719,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_del_period(const char *client_name, struct lyd_node **config);
+int nc_server_config_del_ch_period(const char *client_name, struct lyd_node **config);
 
 /**
  * @brief Creates new YANG configuration data nodes for the anchor time parameter of the Call Home periodic connection type.
@@ -1119,7 +734,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_anchor_time(const struct ly_ctx *ctx, const char *client_name,
+int nc_server_config_add_ch_anchor_time(const struct ly_ctx *ctx, const char *client_name,
         const char *anchor_time, struct lyd_node **config);
 
 /**
@@ -1129,7 +744,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_del_anchor_time(const char *client_name, struct lyd_node **config);
+int nc_server_config_del_ch_anchor_time(const char *client_name, struct lyd_node **config);
 
 /**
  * @brief Creates new YANG configuration data nodes for the idle timeout parameter of the Call Home periodic connection type.
@@ -1144,7 +759,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_idle_timeout(const struct ly_ctx *ctx, const char *client_name,
+int nc_server_config_add_ch_idle_timeout(const struct ly_ctx *ctx, const char *client_name,
         uint16_t idle_timeout, struct lyd_node **config);
 
 /**
@@ -1156,7 +771,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_del_idle_timeout(const char *client_name, struct lyd_node **config);
+int nc_server_config_del_ch_idle_timeout(const char *client_name, struct lyd_node **config);
 
 /**
  * @brief Creates new YANG configuration data nodes for the Call Home reconnect strategy.
@@ -1171,7 +786,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_reconnect_strategy(const struct ly_ctx *ctx, const char *client_name,
+int nc_server_config_add_ch_reconnect_strategy(const struct ly_ctx *ctx, const char *client_name,
         NC_CH_START_WITH start_with, uint16_t max_wait, uint8_t max_attempts, struct lyd_node **config);
 
 /**
@@ -1183,7 +798,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_del_reconnect_strategy(const char *client_name, struct lyd_node **config);
+int nc_server_config_del_ch_reconnect_strategy(const char *client_name, struct lyd_node **config);
 
 /**
  * @} Call Home Server Configuration Functions
@@ -1217,7 +832,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_ssh_hostkey(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
+int nc_server_config_add_ch_ssh_hostkey(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
         const char *hostkey_name, const char *privkey_path, const char *pubkey_path, struct lyd_node **config);
 
 /**
@@ -1230,39 +845,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_ssh_del_hostkey(const char *client_name, const char *endpt_name,
-        const char *hostkey_name, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG data nodes for a reference to an asymmetric key located in the keystore.
- *
- * This asymmetric key pair will be used as the Call Home SSH hostkey.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
- * If the client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in] hostkey_name Arbitrary identifier of the endpoint's hostkey.
- * If the endpoint's hostkey with this identifier already exists, its contents will be changed.
- * @param[in] keystore_reference Name of the asymmetric key pair to be referenced and used as a hostkey.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_ssh_keystore_ref(const struct ly_ctx *ctx, const char *client_name,
-        const char *endpt_name, const char *hostkey_name, const char *keystore_reference, struct lyd_node **config);
-
-/**
- * @brief Deletes a Call Home keystore reference from the YANG data.
- *
- * @param[in] client_name Identifier of an existing Call Home client.
- * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
- * @param[in] hostkey_name Identifier of an existing hostkey that belongs to the given CH endpoint.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_ssh_del_keystore_ref(const char *client_name, const char *endpt_name,
+int nc_server_config_del_ch_ssh_hostkey(const char *client_name, const char *endpt_name,
         const char *hostkey_name, struct lyd_node **config);
 
 /**
@@ -1279,7 +862,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_ssh_auth_attempts(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
+int nc_server_config_add_ch_ssh_auth_attempts(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
         uint16_t auth_attempts, struct lyd_node **config);
 
 /**
@@ -1296,7 +879,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_ssh_auth_timeout(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
+int nc_server_config_add_ch_ssh_auth_timeout(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
         uint16_t auth_timeout, struct lyd_node **config);
 
 /**
@@ -1316,7 +899,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_ssh_user_pubkey(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
+int nc_server_config_add_ch_ssh_user_pubkey(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
         const char *user_name, const char *pubkey_name, const char *pubkey_path, struct lyd_node **config);
 
 /**
@@ -1330,7 +913,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_ssh_del_user_pubkey(const char *client_name, const char *endpt_name,
+int nc_server_config_del_ch_ssh_user_pubkey(const char *client_name, const char *endpt_name,
         const char *user_name, const char *pubkey_name, struct lyd_node **config);
 
 /**
@@ -1348,7 +931,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_ssh_user_password(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
+int nc_server_config_add_ch_ssh_user_password(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
         const char *user_name, const char *password, struct lyd_node **config);
 
 /**
@@ -1360,36 +943,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_ssh_del_user_password(const char *client_name, const char *endpt_name,
-        const char *user_name, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for a Call Home SSH user's none authentication method.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
- * If the client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in] user_name Arbitrary identifier of the endpoint's user.
- * If the endpoint's user with this identifier already exists, its contents will be changed.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_ssh_user_none(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
-        const char *user_name, struct lyd_node **config);
-
-/**
- * @brief Deletes a Call Home SSH user's none authentication method from the YANG data.
- *
- * @param[in] client_name Identifier of an existing Call Home client.
- * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
- * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_ssh_del_user_none(const char *client_name, const char *endpt_name,
+int nc_server_config_del_ch_ssh_user_password(const char *client_name, const char *endpt_name,
         const char *user_name, struct lyd_node **config);
 
 /**
@@ -1410,7 +964,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_ssh_user_interactive(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
+int nc_server_config_add_ch_ssh_user_interactive(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
         const char *user_name, const char *pam_config_name, const char *pam_config_dir, struct lyd_node **config);
 
 /**
@@ -1422,7 +976,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_ssh_del_user_interactive(const char *client_name, const char *endpt_name,
+int nc_server_config_del_ch_ssh_user_interactive(const char *client_name, const char *endpt_name,
         const char *user_name, struct lyd_node **config);
 
 /**
@@ -1434,174 +988,10 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_ssh_del_user(const char *client_name, const char *endpt_name,
+int nc_server_config_del_ch_ssh_user(const char *client_name, const char *endpt_name,
         const char *user_name, struct lyd_node **config);
 
 /**
- * @brief Creates new YANG data nodes for a reference to a public key bag located in the truststore.
- *
- * The public key's located in the bag will be used for Call Home SSH client authentication.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
- * If the client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in] user_name Arbitrary identifier of the endpoint's user.
- * If the endpoint's user with this identifier already exists, its contents will be changed.
- * @param[in] truststore_reference Name of the public key bag to be referenced and used for authentication.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_ssh_truststore_ref(const struct ly_ctx *ctx, const char *client_name,
-        const char *endpt_name, const char *user_name, const char *truststore_reference, struct lyd_node **config);
-
-/**
- * @brief Deletes a Call Home SSH truststore reference from the YANG data.
- *
- * @param[in] client_name Identifier of an existing Call Home client.
- * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
- * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_ssh_del_truststore_ref(const char *client_name, const char *endpt_name,
-        const char *user_name, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for Call Home host-key algorithms replacing any previous ones.
- *
- * Supported algorithms are: ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521,
- * rsa-sha2-512, rsa-sha2-256, ssh-rsa and ssh-dss.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
- * If the client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @param[in] alg_count Number of following algorithms.
- * @param[in] ... String literals of host-key algorithms in a decreasing order of preference.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_ssh_host_key_algs(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
-        struct lyd_node **config, int alg_count, ...);
-
-/**
- * @brief Deletes a Call Home hostkey algorithm from the YANG data.
- *
- * @param[in] client_name Identifier of an existing Call Home client.
- * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
- * @param[in] alg Optional algorithm to be deleted.
- * If NULL, all of the hostkey algorithms on this endpoint will be deleted.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_ssh_del_host_key_alg(const char *client_name, const char *endpt_name,
-        const char *alg, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for Call Home key exchange algorithms replacing any previous ones.
- *
- * Supported algorithms are: diffie-hellman-group-exchange-sha1, curve25519-sha256, ecdh-sha2-nistp256,
- * ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group18-sha512, diffie-hellman-group16-sha512,
- * diffie-hellman-group-exchange-sha256 and diffie-hellman-group14-sha256.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
- * If the client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @param[in] alg_count Number of following algorithms.
- * @param[in] ... String literals of key exchange algorithms in a decreasing order of preference.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_ssh_key_exchange_algs(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
-        struct lyd_node **config, int alg_count, ...);
-
-/**
- * @brief Deletes a Call Home key exchange algorithm from the YANG data.
- *
- * @param[in] client_name Identifier of an existing Call Home client.
- * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
- * @param[in] alg Optional algorithm to be deleted.
- * If NULL, all of the key exchange algorithms on this endpoint will be deleted.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_ssh_del_key_exchange_alg(const char *client_name, const char *endpt_name,
-        const char *alg, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for Call Home encryption algorithms replacing any previous ones.
- *
- * Supported algorithms are: aes256-ctr, aes192-ctr, aes128-ctr, aes256-cbc, aes192-cbc, aes128-cbc, blowfish-cbc
- * triple-des-cbc and none.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
- * If the client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @param[in] alg_count Number of following algorithms.
- * @param[in] ... String literals of encryption algorithms in a decreasing order of preference.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_ssh_encryption_algs(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
-        struct lyd_node **config, int alg_count, ...);
-
-/**
- * @brief Deletes a Call Home encryption algorithm from the YANG data.
- *
- * @param[in] client_name Identifier of an existing Call Home client.
- * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
- * @param[in] alg Optional algorithm to be deleted.
- * If NULL, all of the encryption algorithms on this endpoint will be deleted.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_ssh_del_encryption_alg(const char *client_name, const char *endpt_name,
-        const char *alg, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for Call Home mac algorithms replacing any previous ones.
- *
- * Supported algorithms are: hmac-sha2-256, hmac-sha2-512 and hmac-sha1.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
- * If the client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @param[in] alg_count Number of following algorithms.
- * @param[in] ... String literals of mac algorithms in a decreasing order of preference.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_ssh_mac_algs(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
-        struct lyd_node **config, int alg_count, ...);
-
-/**
- * @brief Deletes a Call Home mac algorithm from the YANG data.
- *
- * @param[in] client_name Identifier of an existing Call Home client.
- * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
- * @param[in] alg Optional algorithm to be deleted.
- * If NULL, all of the mac algorithms on this endpoint will be deleted.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_ssh_del_mac_alg(const char *client_name, const char *endpt_name,
-        const char *alg, struct lyd_node **config);
-
-/**
  * @} SSH Call Home Server Configuration
  */
 
@@ -1629,7 +1019,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_tls_server_certificate(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
+int nc_server_config_add_ch_tls_server_cert(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
         const char *privkey_path, const char *pubkey_path, const char *certificate_path, struct lyd_node **config);
 
 /**
@@ -1640,35 +1030,7 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_tls_del_server_certificate(const char *client_name, const char *endpt_name,
-        struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for a keystore reference to the Call Home TLS server's certificate.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
- * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in] asym_key_ref Name of the asymmetric key pair in the keystore to be referenced.
- * @param[in] cert_ref Name of the certificate, which must belong to the given asymmetric key pair, to be referenced.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_tls_keystore_ref(const struct ly_ctx *ctx, const char *client_name,
-        const char *endpt_name, const char *asym_key_ref, const char *cert_ref, struct lyd_node **config);
-
-/**
- * @brief Deletes a TLS server certificate keystore reference from the YANG data.
- *
- * @param[in] client_name Identifier of an existing Call Home client.
- * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_tls_del_keystore_ref(const char *client_name, const char *endpt_name,
+int nc_server_config_del_ch_tls_server_cert(const char *client_name, const char *endpt_name,
         struct lyd_node **config);
 
 /**
@@ -1686,7 +1048,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_tls_client_certificate(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
+int nc_server_config_add_ch_tls_client_cert(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
         const char *cert_name, const char *cert_path, struct lyd_node **config);
 
 /**
@@ -1699,37 +1061,10 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_tls_del_client_certificate(const char *client_name, const char *endpt_name,
+int nc_server_config_del_ch_tls_client_cert(const char *client_name, const char *endpt_name,
         const char *cert_name, struct lyd_node **config);
 
 /**
- * @brief Creates new YANG configuration data nodes for a Call Home truststore reference to a set of client (end-entity) certificates.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
- * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_tls_client_cert_truststore_ref(const struct ly_ctx *ctx, const char *client_name,
-        const char *endpt_name, const char *cert_bag_ref, struct lyd_node **config);
-
-/**
- * @brief Deletes a Call Home client (end-entity) certificates truststore reference from the YANG data.
- *
- * @param[in] client_name Identifier of an existing Call Home client.
- * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_tls_del_client_cert_truststore_ref(const char *client_name, const char *endpt_name,
-        struct lyd_node **config);
-
-/**
  * @brief Creates new YANG configuration data nodes for a client certificate authority (trust-anchor) certificate.
  *
  * @param[in] ctx libyang context.
@@ -1744,7 +1079,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_tls_client_ca(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
+int nc_server_config_add_ch_tls_ca_cert(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
         const char *cert_name, const char *cert_path, struct lyd_node **config);
 
 /**
@@ -1757,37 +1092,10 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_tls_del_client_ca(const char *client_name, const char *endpt_name,
+int nc_server_config_del_ch_tls_ca_cert(const char *client_name, const char *endpt_name,
         const char *cert_name, struct lyd_node **config);
 
 /**
- * @brief Creates new YANG configuration data nodes for a Call Home truststore reference to a set of client certificate authority (trust-anchor) certificates.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
- * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_tls_client_ca_truststore_ref(const struct ly_ctx *ctx, const char *client_name,
-        const char *endpt_name, const char *cert_bag_ref, struct lyd_node **config);
-
-/**
- * @brief Deletes a Call Home client certificate authority (trust-anchor) certificates truststore reference from the YANG data.
- *
- * @param[in] client_name Identifier of an existing Call Home client.
- * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_tls_del_client_ca_truststore_ref(const char *client_name, const char *endpt_name,
-        struct lyd_node **config);
-
-/**
  * @brief Creates new YANG configuration data nodes for a Call Home cert-to-name entry.
  *
  * @param[in] ctx libyang context.
@@ -1804,7 +1112,7 @@
  * Otherwise the new YANG data will be added to the previous data and may override it.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_tls_ctn(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
+int nc_server_config_add_ch_tls_ctn(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
         uint32_t id, const char *fingerprint, NC_TLS_CTN_MAPTYPE map_type, const char *name, struct lyd_node **config);
 
 /**
@@ -1817,142 +1125,10 @@
  * @param[in,out] config Modified configuration YANG data tree.
  * @return 0 on success, non-zero otherwise.
  */
-int nc_server_config_new_ch_tls_del_ctn(const char *client_name, const char *endpt_name,
+int nc_server_config_del_ch_tls_ctn(const char *client_name, const char *endpt_name,
         uint32_t id, struct lyd_node **config);
 
 /**
- * @brief Creates new YANG configuration data nodes for a Call Home TLS version.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
- * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in] tls_version TLS version to be used. Call this multiple times to set the accepted versions
- * of the TLS protocol and let the client and server negotiate the given version.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_tls_version(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
-        NC_TLS_VERSION tls_version, struct lyd_node **config);
-
-/**
- * @brief Deletes a TLS version from the YANG data.
- *
- * @param[in] client_name Identifier of an existing Call Home client.
- * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client.
- * @param[in] tls_version TLS version to be deleted.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_tls_del_version(const char *client_name, const char *endpt_name,
-        NC_TLS_VERSION tls_version, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for a Call Home TLS cipher.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
- * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @param[in] cipher_count Number of following ciphers.
- * @param[in] ... TLS ciphers. These ciphers MUST be in the format as listed in the
- * iana-tls-cipher-suite-algs YANG model (lowercase and separated by dashes). Regardless
- * of the TLS protocol version used, all of these ciphers will be tried and some of them
- * might not be set (TLS handshake might fail then). For the list of supported ciphers see
- * the OpenSSL documentation.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_tls_ciphers(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
-        struct lyd_node **config, int cipher_count, ...);
-
-/**
- * @brief Deletes a Call Home TLS cipher from the YANG data.
- *
- * @param[in] client_name Identifier of an existing Call Home client.
- * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client.
- * @param[in] cipher TLS cipher to be deleted.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_tls_del_cipher(const char *client_name, const char *endpt_name,
-        const char *cipher, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for a Call Home Certificate Revocation List via a local file.
- *
- * Beware that you can choose up to one function between the three CRL alternatives on a given endpoint and calling
- * this function will remove any CRL YANG nodes created by the other two functions.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
- * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in] crl_path Path to a DER/PEM encoded CRL file.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_tls_crl_path(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
-        const char *crl_path, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for a Call Home Certificate Revocation List via an URL.
- *
- * Beware that you can choose up to one function between the three CRL alternatives on a given endpoint and calling
- * this function will remove any CRL YANG nodes created by the other two functions.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
- * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in] crl_url URL from which the CRL file will be downloaded. The file has to be in the DER or PEM format.
- * The allowed protocols are all the protocols supported by CURL.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_tls_crl_url(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
-        const char *crl_url, struct lyd_node **config);
-
-/**
- * @brief Creates new YANG configuration data nodes for a Call Home Certificate Revocation List via certificate extensions.
- *
- * The chain of configured Certificate Authorities will be examined. For each certificate in this chain all the
- * CRLs from the URLs specified in their extension fields CRL Distribution Points will be downloaded and used.
- *
- * Beware that you can choose up to one function between the three CRL alternatives on a given endpoint and calling
- * this function will remove any CRL YANG nodes created by the other two functions.
- *
- * @param[in] ctx libyang context.
- * @param[in] client_name Arbitrary identifier of the Call Home client.
- * If a Call Home client with this identifier already exists, its contents will be changed.
- * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
- * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
- * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
- * Otherwise the new YANG data will be added to the previous data and may override it.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_tls_crl_cert_ext(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
-        struct lyd_node **config);
-
-/**
- * @brief Deletes all the CRL nodes from the YANG data.
- *
- * @param[in] client_name Identifier of an existing Call Home client.
- * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client.
- * @param[in,out] config Modified configuration YANG data tree.
- * @return 0 on success, non-zero otherwise.
- */
-int nc_server_config_new_ch_tls_del_crl(const char *client_name, const char *endpt_name, struct lyd_node **config);
-
-/**
  * @} TLS Call Home Server Configuration
  */
 
