OpenDNSSEC-enforcer 2.1.13
|
Go to the source code of this file.
Data Structures | |
struct | hsm_key |
struct | hsm_key_list |
Macros | |
#define | HSM_KEY_ROLE_SEP(role) ((role) == HSM_KEY_ROLE_KSK || (role) == HSM_KEY_ROLE_CSK) |
Typedefs | |
typedef struct hsm_key | hsm_key_t |
typedef struct hsm_key_list | hsm_key_list_t |
typedef enum hsm_key_state | hsm_key_state_t |
typedef enum hsm_key_role | hsm_key_role_t |
typedef enum hsm_key_key_type | hsm_key_key_type_t |
typedef enum hsm_key_backup | hsm_key_backup_t |
Enumerations | |
enum | hsm_key_state { HSM_KEY_STATE_INVALID = -1 , HSM_KEY_STATE_UNUSED = 1 , HSM_KEY_STATE_PRIVATE = 2 , HSM_KEY_STATE_SHARED = 3 , HSM_KEY_STATE_DELETE = 4 } |
enum | hsm_key_role { HSM_KEY_ROLE_INVALID = -1 , HSM_KEY_ROLE_KSK = 1 , HSM_KEY_ROLE_ZSK = 2 , HSM_KEY_ROLE_CSK = 3 } |
enum | hsm_key_key_type { HSM_KEY_KEY_TYPE_INVALID = -1 , HSM_KEY_KEY_TYPE_RSA = 1 } |
enum | hsm_key_backup { HSM_KEY_BACKUP_INVALID = -1 , HSM_KEY_BACKUP_NO_BACKUP = 0 , HSM_KEY_BACKUP_BACKUP_REQUIRED = 1 , HSM_KEY_BACKUP_BACKUP_REQUESTED = 2 , HSM_KEY_BACKUP_BACKUP_DONE = 3 } |
Variables | |
const db_enum_t | hsm_key_enum_set_state [] |
const db_enum_t | hsm_key_enum_set_role [] |
const db_enum_t | hsm_key_enum_set_backup [] |
#define HSM_KEY_ROLE_SEP | ( | role | ) | ((role) == HSM_KEY_ROLE_KSK || (role) == HSM_KEY_ROLE_CSK) |
typedef enum hsm_key_backup hsm_key_backup_t |
typedef enum hsm_key_key_type hsm_key_key_type_t |
typedef struct hsm_key_list hsm_key_list_t |
typedef enum hsm_key_role hsm_key_role_t |
typedef enum hsm_key_state hsm_key_state_t |
enum hsm_key_backup |
enum hsm_key_key_type |
enum hsm_key_role |
enum hsm_key_state |
unsigned int hsm_key_algorithm | ( | const hsm_key_t * | hsm_key | ) |
Get the algorithm of a hsm key object. Undefined behavior if hsm_key
is NULL.
[in] | hsm_key | a hsm_key_t pointer. |
Definition at line 544 of file hsm_key.c.
References hsm_key::algorithm.
db_clause_t * hsm_key_algorithm_clause | ( | db_clause_list_t * | clause_list, |
unsigned int | algorithm | ||
) |
Create a clause for algorithm of a hsm key object and add it to a database clause list. The clause operator is set to DB_CLAUSE_OPERATOR_AND and the clause type is set to DB_CLAUSE_EQUAL, if you want to change these you can do it with the returned db_clause_t pointer.
[in] | clause_list | db_clause_list_t pointer. |
[in] | algorithm | an unsigned integer. |
hsm_key_backup_t hsm_key_backup | ( | const hsm_key_t * | hsm_key | ) |
Get the backup of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
Definition at line 576 of file hsm_key.c.
References hsm_key::backup, and HSM_KEY_BACKUP_INVALID.
db_clause_t * hsm_key_backup_clause | ( | db_clause_list_t * | clause_list, |
hsm_key_backup_t | backup | ||
) |
Create a clause for backup of a hsm key object and add it to a database clause list. The clause operator is set to DB_CLAUSE_OPERATOR_AND and the clause type is set to DB_CLAUSE_EQUAL, if you want to change these you can do it with the returned db_clause_t pointer.
[in] | clause_list | db_clause_list_t pointer. |
[in] | backup | a hsm_key_backup_t. |
unsigned int hsm_key_bits | ( | const hsm_key_t * | hsm_key | ) |
Get the bits of a hsm key object. Undefined behavior if hsm_key
is NULL.
[in] | hsm_key | a hsm_key_t pointer. |
Definition at line 536 of file hsm_key.c.
References hsm_key::bits.
db_clause_t * hsm_key_bits_clause | ( | db_clause_list_t * | clause_list, |
unsigned int | bits | ||
) |
Create a clause for bits of a hsm key object and add it to a database clause list. The clause operator is set to DB_CLAUSE_OPERATOR_AND and the clause type is set to DB_CLAUSE_EQUAL, if you want to change these you can do it with the returned db_clause_t pointer.
[in] | clause_list | db_clause_list_t pointer. |
[in] | bits | an unsigned integer. |
Copy the content of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
[in] | hsm_key_copy | a hsm_key_t pointer. |
Definition at line 307 of file hsm_key.c.
References hsm_key::algorithm, hsm_key::associated_policy_id, hsm_key::backup, hsm_key::bits, DB_ERROR_UNKNOWN, DB_OK, db_value_copy(), hsm_key_copy(), hsm_key::id, hsm_key::inception, hsm_key::is_revoked, hsm_key::key_type, hsm_key::locator, policy_free(), hsm_key::policy_id, policy_new_copy(), hsm_key::private_policy_id, hsm_key::repository, hsm_key::rev, hsm_key::role, and hsm_key::state.
Referenced by hsm_key_copy(), hsm_key_new_copy(), and key_data_get_hsm_key().
int hsm_key_count | ( | hsm_key_t * | hsm_key, |
db_clause_list_t * | clause_list, | ||
size_t * | count | ||
) |
Count the number of hsm key objects in the database, if a selection of objects should be counted then it can be limited by a database clause list otherwise all objects are counted.
[in] | hsm_key | a hsm_key_t pointer. |
[in] | clause_list | a db_clause_list_t pointer or NULL if all objects. |
[out] | count | a size_t pointer to where the count should be stored. should be counted. |
int hsm_key_create | ( | hsm_key_t * | hsm_key | ) |
void hsm_key_free | ( | hsm_key_t * | hsm_key | ) |
Delete a hsm key object, this does not delete it from the database.
[in] | hsm_key | a hsm_key_t pointer. |
Definition at line 286 of file hsm_key.c.
References db_object_free(), db_value_reset(), hsm_key::dbo, hsm_key::id, hsm_key::locator, policy_free(), hsm_key::policy_id, hsm_key::private_policy_id, hsm_key::repository, and hsm_key::rev.
Referenced by hsm_key_list_copy(), hsm_key_list_free(), hsm_key_new_copy(), key_data_cache_hsm_key(), key_data_copy(), key_data_free(), and key_data_get_hsm_key().
int hsm_key_from_result | ( | hsm_key_t * | hsm_key, |
const db_result_t * | result | ||
) |
int hsm_key_get_by_id | ( | hsm_key_t * | hsm_key, |
const db_value_t * | id | ||
) |
Get a hsm key object from the database by a id specified in id
.
[in] | hsm_key | a hsm_key_t pointer. |
[in] | id | a db_value_t pointer. |
Definition at line 1102 of file hsm_key.c.
Referenced by key_data_cache_hsm_key(), and key_data_get_hsm_key().
int hsm_key_get_by_locator | ( | hsm_key_t * | hsm_key, |
const char * | locator | ||
) |
const db_value_t * hsm_key_id | ( | const hsm_key_t * | hsm_key | ) |
Get the id of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
Definition at line 504 of file hsm_key.c.
References hsm_key::id.
Referenced by key_data_get_hsm_key(), and key_data_set_hsm_key_id().
unsigned int hsm_key_inception | ( | const hsm_key_t * | hsm_key | ) |
Get the inception of a hsm key object. Undefined behavior if hsm_key
is NULL.
[in] | hsm_key | a hsm_key_t pointer. |
Definition at line 560 of file hsm_key.c.
References hsm_key::inception.
db_clause_t * hsm_key_is_revoked_clause | ( | db_clause_list_t * | clause_list, |
unsigned int | is_revoked | ||
) |
Create a clause for is_revoked of a hsm key object and add it to a database clause list. The clause operator is set to DB_CLAUSE_OPERATOR_AND and the clause type is set to DB_CLAUSE_EQUAL, if you want to change these you can do it with the returned db_clause_t pointer.
[in] | clause_list | db_clause_list_t pointer. |
[in] | is_revoked | an unsigned integer. |
db_clause_t * hsm_key_key_type_clause | ( | db_clause_list_t * | clause_list, |
hsm_key_key_type_t | key_type | ||
) |
Create a clause for key_type of a hsm key object and add it to a database clause list. The clause operator is set to DB_CLAUSE_OPERATOR_AND and the clause type is set to DB_CLAUSE_EQUAL, if you want to change these you can do it with the returned db_clause_t pointer.
[in] | clause_list | db_clause_list_t pointer. |
[in] | key_type | a hsm_key_key_type_t. |
const hsm_key_t * hsm_key_list_begin | ( | hsm_key_list_t * | hsm_key_list | ) |
Get the first hsm key object in a hsm key object list and reset the position of the list.
[in] | hsm_key_list | a hsm_key_list_t pointer. |
int hsm_key_list_copy | ( | hsm_key_list_t * | hsm_key_list, |
const hsm_key_list_t * | from_hsm_key_list | ||
) |
free global allocator. hsm_key_list_free MUST be called for all its contents. Copy the content of another hsm key object list.
[in] | hsm_key_list | a hsm_key_list_t pointer. |
[in] | from_hsm_key_list | a hsm_key_list_t pointer. |
Definition at line 1524 of file hsm_key.c.
References hsm_key_list::associated_fetch, DB_ERROR_UNKNOWN, DB_OK, db_result_list_free(), db_result_list_new_copy(), hsm_key_free(), hsm_key_new_copy(), hsm_key_list::object_list, hsm_key_list::object_list_first, hsm_key_list::object_list_position, hsm_key_list::object_list_size, hsm_key_list::object_store, hsm_key_list::policy_id_list, policy_list_new_copy(), and hsm_key_list::result_list.
Referenced by hsm_key_list_new_copy().
void hsm_key_list_free | ( | hsm_key_list_t * | hsm_key_list | ) |
Delete a hsm key object list.
[in] | hsm_key_list | a hsm_key_list_t pointer. |
Definition at line 1496 of file hsm_key.c.
References db_object_free(), db_result_list_free(), hsm_key_list::dbo, hsm_key_list::hsm_key, hsm_key_free(), hsm_key_list::object_list, hsm_key_list::object_list_size, hsm_key_list::policy_id_list, policy_list_free(), and hsm_key_list::result_list.
Referenced by hsm_key_list_new_copy(), key_data_list_free(), policy_copy(), and policy_free().
hsm_key_t * hsm_key_list_get_begin | ( | hsm_key_list_t * | hsm_key_list | ) |
Get the first hsm key object in a hsm key object list and reset the position of the list. The caller will be given ownership of this object and is responsible for freeing it.
[in] | hsm_key_list | a hsm_key_list_t pointer. |
int hsm_key_list_get_by_clauses | ( | hsm_key_list_t * | hsm_key_list, |
const db_clause_list_t * | clause_list | ||
) |
Get hsm key objects from the database by a clause list.
[in] | hsm_key_list | a hsm_key_list_t pointer. |
[in] | clause_list | a db_clause_list_t pointer. |
int hsm_key_list_get_by_policy_id | ( | hsm_key_list_t * | hsm_key_list, |
const db_value_t * | policy_id | ||
) |
Get hsm key objects from the database by a policy_id specified in policy_id
.
[in] | hsm_key_list | a hsm_key_list_t pointer. |
[in] | policy_id | a db_value_t pointer. |
hsm_key_t * hsm_key_list_get_next | ( | hsm_key_list_t * | hsm_key_list | ) |
Get the next hsm key object in a hsm key object list. The caller will be given ownership of this object and is responsible for freeing it.
[in] | hsm_key_list | a hsm_key_list_t pointer. |
hsm_key_list_t * hsm_key_list_new | ( | const db_connection_t * | connection | ) |
Create a new hsm key object list.
[in] | connection | a db_connection_t pointer. |
Definition at line 1453 of file hsm_key.c.
Referenced by hsm_key_list_new_copy().
hsm_key_list_t * hsm_key_list_new_copy | ( | const hsm_key_list_t * | hsm_key_copy | ) |
Create a new hsm key object list that is a copy of another.
[in] | hsm_key_list | a hsm_key_list_t pointer. |
Definition at line 1467 of file hsm_key.c.
References db_object_connection(), hsm_key_list::dbo, hsm_key_list_copy(), hsm_key_list_free(), and hsm_key_list_new().
Referenced by key_data_list_copy(), and policy_copy().
hsm_key_list_t * hsm_key_list_new_get_by_clauses | ( | const db_connection_t * | connection, |
const db_clause_list_t * | clause_list | ||
) |
hsm_key_list_t * hsm_key_list_new_get_by_policy_id | ( | const db_connection_t * | connection, |
const db_value_t * | policy_id | ||
) |
const hsm_key_t * hsm_key_list_next | ( | hsm_key_list_t * | hsm_key_list | ) |
Get the next hsm key object in a hsm key object list. Ownership of this object is retained within the list and the object is only valid until the next call to this function.
[in] | hsm_key_list | a hsm_key_list_t pointer. |
int hsm_key_list_object_store | ( | hsm_key_list_t * | hsm_key_list | ) |
Specify that objects should be stored within the list as they are fetch, this is optimal if the list is to be iterated over more then once.
[in] | hsm_key_list | a hsm_key_list_t pointer. |
Definition at line 1486 of file hsm_key.c.
References DB_ERROR_UNKNOWN, DB_OK, and hsm_key_list::object_store.
const char * hsm_key_locator | ( | const hsm_key_t * | hsm_key | ) |
Get the locator of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
Definition at line 520 of file hsm_key.c.
References hsm_key::locator.
hsm_key_t * hsm_key_new | ( | const db_connection_t * | connection | ) |
Create a new hsm key object.
[in] | connection | a db_connection_t pointer. |
Definition at line 244 of file hsm_key.c.
Referenced by hsm_key_new_copy(), key_data_cache_hsm_key(), and key_data_get_hsm_key().
Create a new hsm key object that is a copy of another hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
Definition at line 267 of file hsm_key.c.
References db_object_connection(), hsm_key::dbo, hsm_key_copy(), hsm_key_free(), and hsm_key_new().
Referenced by hsm_key_list_copy(), and key_data_copy().
hsm_key_t * hsm_key_new_get_by_locator | ( | const db_connection_t * | connection, |
const char * | locator | ||
) |
const db_value_t * hsm_key_policy_id | ( | const hsm_key_t * | hsm_key | ) |
Get the policy_id of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
Definition at line 512 of file hsm_key.c.
References hsm_key::policy_id.
db_clause_t * hsm_key_policy_id_clause | ( | db_clause_list_t * | clause_list, |
const db_value_t * | policy_id | ||
) |
Create a clause for policy_id of a hsm key object and add it to a database clause list. The clause operator is set to DB_CLAUSE_OPERATOR_AND and the clause type is set to DB_CLAUSE_EQUAL, if you want to change these you can do it with the returned db_clause_t pointer.
[in] | clause_list | db_clause_list_t pointer. |
[in] | policy_id | a db_value_t pointer. |
const char * hsm_key_repository | ( | const hsm_key_t * | hsm_key | ) |
Get the repository of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
Definition at line 568 of file hsm_key.c.
References hsm_key::repository.
db_clause_t * hsm_key_repository_clause | ( | db_clause_list_t * | clause_list, |
const char * | repository_text | ||
) |
Create a clause for repository of a hsm key object and add it to a database clause list. The clause operator is set to DB_CLAUSE_OPERATOR_AND and the clause type is set to DB_CLAUSE_EQUAL, if you want to change these you can do it with the returned db_clause_t pointer.
[in] | clause_list | db_clause_list_t pointer. |
[in] | repository_text | a character pointer. |
hsm_key_role_t hsm_key_role | ( | const hsm_key_t * | hsm_key | ) |
Get the role of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
Definition at line 552 of file hsm_key.c.
References HSM_KEY_ROLE_INVALID, and hsm_key::role.
db_clause_t * hsm_key_role_clause | ( | db_clause_list_t * | clause_list, |
hsm_key_role_t | role | ||
) |
Create a clause for role of a hsm key object and add it to a database clause list. The clause operator is set to DB_CLAUSE_OPERATOR_AND and the clause type is set to DB_CLAUSE_EQUAL, if you want to change these you can do it with the returned db_clause_t pointer.
[in] | clause_list | db_clause_list_t pointer. |
[in] | role | a hsm_key_role_t. |
int hsm_key_set_algorithm | ( | hsm_key_t * | hsm_key, |
unsigned int | algorithm | ||
) |
Set the algorithm of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
[in] | algorithm | an unsigned integer. |
Definition at line 648 of file hsm_key.c.
References hsm_key::algorithm, DB_ERROR_UNKNOWN, and DB_OK.
int hsm_key_set_backup | ( | hsm_key_t * | hsm_key, |
hsm_key_backup_t | backup | ||
) |
Set the backup of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
[in] | backup | a hsm_key_backup_t. |
Definition at line 716 of file hsm_key.c.
References hsm_key::backup, DB_ERROR_UNKNOWN, DB_OK, and HSM_KEY_BACKUP_INVALID.
int hsm_key_set_bits | ( | hsm_key_t * | hsm_key, |
unsigned int | bits | ||
) |
Set the bits of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
[in] | bits | an unsigned integer. |
Definition at line 638 of file hsm_key.c.
References hsm_key::bits, DB_ERROR_UNKNOWN, and DB_OK.
int hsm_key_set_inception | ( | hsm_key_t * | hsm_key, |
unsigned int | inception | ||
) |
Set the inception of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
[in] | inception | an unsigned integer. |
Definition at line 671 of file hsm_key.c.
References DB_ERROR_UNKNOWN, DB_OK, and hsm_key::inception.
int hsm_key_set_key_type | ( | hsm_key_t * | hsm_key, |
hsm_key_key_type_t | key_type | ||
) |
Set the key_type of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
[in] | key_type | a hsm_key_key_type_t. |
Definition at line 681 of file hsm_key.c.
References DB_ERROR_UNKNOWN, DB_OK, HSM_KEY_KEY_TYPE_INVALID, and hsm_key::key_type.
int hsm_key_set_locator | ( | hsm_key_t * | hsm_key, |
const char * | locator_text | ||
) |
Set the locator of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
[in] | locator_text | a character pointer. |
Definition at line 603 of file hsm_key.c.
References DB_ERROR_UNKNOWN, DB_OK, and hsm_key::locator.
int hsm_key_set_policy_id | ( | hsm_key_t * | hsm_key, |
const db_value_t * | policy_id | ||
) |
Set the policy_id of a hsm key object. If this fails the original value may have been lost.
[in] | hsm_key | a hsm_key_t pointer. |
[in] | policy_id | a db_value_t pointer. |
Definition at line 584 of file hsm_key.c.
References DB_ERROR_UNKNOWN, DB_OK, db_value_copy(), db_value_not_empty(), db_value_reset(), hsm_key::policy_id, and policy_id().
int hsm_key_set_repository | ( | hsm_key_t * | hsm_key, |
const char * | repository_text | ||
) |
Set the repository of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
[in] | repository_text | a character pointer. |
Definition at line 694 of file hsm_key.c.
References DB_ERROR_UNKNOWN, DB_OK, and hsm_key::repository.
int hsm_key_set_role | ( | hsm_key_t * | hsm_key, |
hsm_key_role_t | role | ||
) |
Set the role of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
[in] | role | a hsm_key_role_t. |
Definition at line 658 of file hsm_key.c.
References DB_ERROR_UNKNOWN, DB_OK, HSM_KEY_ROLE_INVALID, and hsm_key::role.
int hsm_key_set_state | ( | hsm_key_t * | hsm_key, |
hsm_key_state_t | state | ||
) |
Set the state of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
[in] | state | a hsm_key_state_t. |
Definition at line 625 of file hsm_key.c.
References DB_ERROR_UNKNOWN, DB_OK, HSM_KEY_STATE_INVALID, and hsm_key::state.
hsm_key_state_t hsm_key_state | ( | const hsm_key_t * | hsm_key | ) |
Get the state of a hsm key object.
[in] | hsm_key | a hsm_key_t pointer. |
Definition at line 528 of file hsm_key.c.
References HSM_KEY_STATE_INVALID, and hsm_key::state.
db_clause_t * hsm_key_state_clause | ( | db_clause_list_t * | clause_list, |
hsm_key_state_t | state | ||
) |
Create a clause for state of a hsm key object and add it to a database clause list. The clause operator is set to DB_CLAUSE_OPERATOR_AND and the clause type is set to DB_CLAUSE_EQUAL, if you want to change these you can do it with the returned db_clause_t pointer.
[in] | clause_list | db_clause_list_t pointer. |
[in] | state | a hsm_key_state_t. |
int hsm_key_update | ( | hsm_key_t * | hsm_key | ) |
|
extern |
Definition at line 56 of file hsm_key.c.
Referenced by hsm_key_to_backup_state().