hsm_key.c File Reference
`#include "hsm_key.h"`
`#include "db_error.h"`
`#include <string.h>`

Go to the source code of this file.

## Functions

hsm_key_t * | hsm_key_new (const db_connection_t *connection)
hsm_key_t * | hsm_key_new_copy (const hsm_key_t *hsm_key)
void | hsm_key_free (hsm_key_t *hsm_key)
int | hsm_key_copy (hsm_key_t *hsm_key, const hsm_key_t *hsm_key_copy)
int | hsm_key_from_result (hsm_key_t *hsm_key, const db_result_t *result)
const db_value_t * | hsm_key_id (const hsm_key_t *hsm_key)
const db_value_t * | hsm_key_policy_id (const hsm_key_t *hsm_key)
const char * | hsm_key_locator (const hsm_key_t *hsm_key)
hsm_key_state_t | hsm_key_state (const hsm_key_t *hsm_key)
unsigned int | hsm_key_bits (const hsm_key_t *hsm_key)
unsigned int | hsm_key_algorithm (const hsm_key_t *hsm_key)
hsm_key_role_t | hsm_key_role (const hsm_key_t *hsm_key)
unsigned int | hsm_key_inception (const hsm_key_t *hsm_key)
const char * | hsm_key_repository (const hsm_key_t *hsm_key)
hsm_key_backup_t | hsm_key_backup (const hsm_key_t *hsm_key)
int | hsm_key_set_policy_id (hsm_key_t *hsm_key, const db_value_t *policy_id)
int | hsm_key_set_locator (hsm_key_t *hsm_key, const char *locator_text)
int | hsm_key_set_state (hsm_key_t *hsm_key, hsm_key_state_t state)
int | hsm_key_set_bits (hsm_key_t *hsm_key, unsigned int bits)
int | hsm_key_set_algorithm (hsm_key_t *hsm_key, unsigned int algorithm)
int | hsm_key_set_role (hsm_key_t *hsm_key, hsm_key_role_t role)
int | hsm_key_set_inception (hsm_key_t *hsm_key, unsigned int inception)
int | hsm_key_set_key_type (hsm_key_t *hsm_key, hsm_key_key_type_t key_type)
int | hsm_key_set_repository (hsm_key_t *hsm_key, const char *repository_text)
int | hsm_key_set_backup (hsm_key_t *hsm_key, hsm_key_backup_t backup)
db_clause_t * | hsm_key_policy_id_clause (db_clause_list_t *clause_list, const db_value_t *policy_id)
db_clause_t * | hsm_key_state_clause (db_clause_list_t *clause_list, hsm_key_state_t state)
db_clause_t * | hsm_key_bits_clause (db_clause_list_t *clause_list, unsigned int bits)
db_clause_t * | hsm_key_algorithm_clause (db_clause_list_t *clause_list, unsigned int algorithm)
db_clause_t * | hsm_key_role_clause (db_clause_list_t *clause_list, hsm_key_role_t role)
db_clause_t * | hsm_key_is_revoked_clause (db_clause_list_t *clause_list, unsigned int is_revoked)
db_clause_t * | hsm_key_key_type_clause (db_clause_list_t *clause_list, hsm_key_key_type_t key_type)
db_clause_t * | hsm_key_repository_clause (db_clause_list_t *clause_list, const char *repository_text)
db_clause_t * | hsm_key_backup_clause (db_clause_list_t *clause_list, hsm_key_backup_t backup)
int | hsm_key_create (hsm_key_t *hsm_key)
int | hsm_key_get_by_id (hsm_key_t *hsm_key, const db_value_t *id)
int | hsm_key_get_by_locator (hsm_key_t *hsm_key, const char *locator)
hsm_key_t * | hsm_key_new_get_by_locator (const db_connection_t *connection, const char *locator)
int | hsm_key_update (hsm_key_t *hsm_key)
int | hsm_key_count (hsm_key_t *hsm_key, db_clause_list_t *clause_list, size_t *count)
hsm_key_list_t * | hsm_key_list_new (const db_connection_t *connection)
hsm_key_list_t * | hsm_key_list_new_copy (const hsm_key_list_t *from_hsm_key_list)
int | hsm_key_list_object_store (hsm_key_list_t *hsm_key_list)
void | hsm_key_list_free (hsm_key_list_t *hsm_key_list)
int | hsm_key_list_copy (hsm_key_list_t *hsm_key_list, const hsm_key_list_t *from_hsm_key_list)
int | hsm_key_list_get_by_clauses (hsm_key_list_t *hsm_key_list, const db_clause_list_t *clause_list)
hsm_key_list_t * | hsm_key_list_new_get_by_clauses (const db_connection_t *connection, const db_clause_list_t *clause_list)
int | hsm_key_list_get_by_policy_id (hsm_key_list_t *hsm_key_list, const db_value_t *policy_id)
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_begin (hsm_key_list_t *hsm_key_list)
hsm_key_t * | hsm_key_list_get_begin (hsm_key_list_t *hsm_key_list)
const hsm_key_t * | hsm_key_list_next (hsm_key_list_t *hsm_key_list)
hsm_key_t * | hsm_key_list_get_next (hsm_key_list_t *hsm_key_list)

## 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_key_type []
const db_enum_t | hsm_key_enum_set_backup []

## Function Documentation

## hsm_key_algorithm()

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.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.

Returns
  an unsigned integer.

Definition at line 544 of file hsm_key.c.

References hsm_key::algorithm.

## hsm_key_algorithm_clause()

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.

Parameters

  [in] | clause_list | db_clause_list_t pointer.
  [in] | algorithm | an unsigned integer.

Returns
  a db_clause_t pointer to the added clause or NULL on error.

Definition at line 798 of file hsm_key.c.

References DB_CLAUSE_EQUAL, db_clause_free(), db_clause_get_value(), db_clause_list_add(), db_clause_new(), DB_CLAUSE_OPERATOR_AND, db_clause_set_field(), db_clause_set_operator(), db_clause_set_type(), and db_value_from_uint32().

Referenced by hsm_key_factory_generate(), and hsm_key_factory_get_key().

## hsm_key_backup()

hsm_key_backup_t hsm_key_backup | ( | const hsm_key_t * | hsm_key | ) |

Get the backup of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.

Returns
  a hsm_key_backup_t which may be HSM_KEY_BACKUP_INVALID on error or if no backup has been set.

Definition at line 576 of file hsm_key.c.

References hsm_key::backup, and HSM_KEY_BACKUP_INVALID.

## hsm_key_backup_clause()

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.

Parameters

  [in] | clause_list | db_clause_list_t pointer.
  [in] | backup | a hsm_key_backup_t.

Returns
  a db_clause_t pointer to the added clause or NULL on error.

Definition at line 906 of file hsm_key.c.

References DB_CLAUSE_EQUAL, db_clause_free(), db_clause_get_value(), db_clause_list_add(), db_clause_new(), DB_CLAUSE_OPERATOR_AND, db_clause_set_field(), db_clause_set_operator(), db_clause_set_type(), db_value_from_enum_value(), and hsm_key_enum_set_backup.

## hsm_key_bits()

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.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.

Returns
  an unsigned integer.

Definition at line 536 of file hsm_key.c.

References hsm_key::bits.

## hsm_key_bits_clause()

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.

Parameters

  [in] | clause_list | db_clause_list_t pointer.
  [in] | bits | an unsigned integer.

Returns
  a db_clause_t pointer to the added clause or NULL on error.

Definition at line 777 of file hsm_key.c.

References DB_CLAUSE_EQUAL, db_clause_free(), db_clause_get_value(), db_clause_list_add(), db_clause_new(), DB_CLAUSE_OPERATOR_AND, db_clause_set_field(), db_clause_set_operator(), db_clause_set_type(), and db_value_from_uint32().

Referenced by hsm_key_factory_generate(), and hsm_key_factory_get_key().

## hsm_key_copy()

int hsm_key_copy | ( | hsm_key_t * | hsm_key,
|  | const hsm_key_t * | hsm_key_copy )

Copy the content of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.
  [in] | hsm_key_copy | a hsm_key_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

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_list_get_begin(), hsm_key_list_get_next(), hsm_key_new_copy(), and key_data_get_hsm_key().

## hsm_key_count()

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.

Parameters

  [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.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 1435 of file hsm_key.c.

References DB_ERROR_UNKNOWN, db_object_count(), and hsm_key::dbo.

Referenced by hsm_key_factory_generate().

## hsm_key_create()

int hsm_key_create | ( | hsm_key_t * | hsm_key | ) |

Create a hsm key object in the database.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 927 of file hsm_key.c.

References hsm_key::algorithm, hsm_key::backup, hsm_key::bits, DB_ERROR_UNKNOWN, db_object_create(), db_object_field_free(), db_object_field_list_add(), db_object_field_list_free(), db_object_field_list_new(), db_object_field_new(), db_object_field_set_enum_set(), db_object_field_set_name(), db_object_field_set_type(), DB_TYPE_ANY, DB_TYPE_ENUM, DB_TYPE_TEXT, DB_TYPE_UINT32, db_value_copy(), db_value_from_enum_value(), db_value_from_text(), db_value_from_uint32(), db_value_not_empty(), db_value_set_free(), db_value_set_get(), db_value_set_new(), hsm_key::dbo, hsm_key_enum_set_backup, hsm_key_enum_set_key_type, hsm_key_enum_set_role, hsm_key_enum_set_state, hsm_key::id, hsm_key::inception, hsm_key::is_revoked, hsm_key::key_type, hsm_key::locator, hsm_key::policy_id, hsm_key::repository, hsm_key::rev, hsm_key::role, and hsm_key::state.

Referenced by hsm_key_factory_generate(), and perform_hsmkey_import().

## hsm_key_free()

void hsm_key_free | ( | hsm_key_t * | hsm_key | ) |

Delete a hsm key object, this does not delete it from the database.

Parameters

  [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_factory_generate(), hsm_key_factory_get_key(), hsm_key_factory_release_key_id(), hsm_key_list_copy(), hsm_key_list_free(), hsm_key_list_get_begin(), hsm_key_list_get_by_clauses(), hsm_key_list_get_by_policy_id(), hsm_key_list_get_next(), hsm_key_new_copy(), hsm_key_new_get_by_locator(), key_data_cache_hsm_key(), key_data_copy(), key_data_free(), key_data_get_hsm_key(), perform_hsmkey_import(), perform_keydata_import(), and run_ds_cmd().

## hsm_key_from_result()

int hsm_key_from_result | ( | hsm_key_t * | hsm_key,
|  | const db_result_t * | result )

Set the content of a hsm key object based on a database result.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.
  [in] | result | a db_result_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 405 of file hsm_key.c.

References hsm_key::algorithm, hsm_key::backup, hsm_key::bits, DB_ERROR_UNKNOWN, DB_OK, db_result_value_set(), db_value_copy(), db_value_reset(), db_value_set_at(), db_value_set_size(), db_value_to_enum_value(), db_value_to_text(), db_value_to_uint32(), HSM_KEY_BACKUP_BACKUP_DONE, HSM_KEY_BACKUP_BACKUP_REQUESTED, HSM_KEY_BACKUP_BACKUP_REQUIRED, HSM_KEY_BACKUP_NO_BACKUP, hsm_key_enum_set_backup, hsm_key_enum_set_key_type, hsm_key_enum_set_role, hsm_key_enum_set_state, HSM_KEY_KEY_TYPE_RSA, HSM_KEY_ROLE_CSK, HSM_KEY_ROLE_KSK, HSM_KEY_ROLE_ZSK, HSM_KEY_STATE_DELETE, HSM_KEY_STATE_PRIVATE, HSM_KEY_STATE_SHARED, HSM_KEY_STATE_UNUSED, hsm_key::id, hsm_key::inception, hsm_key::is_revoked, hsm_key::key_type, hsm_key::locator, hsm_key::policy_id, hsm_key::repository, hsm_key::rev, hsm_key::role, and hsm_key::state.

Referenced by hsm_key_get_by_id(), hsm_key_get_by_locator(), hsm_key_list_begin(), hsm_key_list_get_begin(), hsm_key_list_get_next(), and hsm_key_list_next().

## hsm_key_get_by_id()

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.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.
  [in] | id | a db_value_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 1102 of file hsm_key.c.

References DB_CLAUSE_EQUAL, db_clause_free(), db_clause_get_value(), db_clause_list_add(), db_clause_list_free(), db_clause_list_new(), db_clause_new(), db_clause_set_field(), db_clause_set_type(), DB_ERROR_UNKNOWN, db_object_read(), DB_OK, db_result_list_free(), db_result_list_next(), db_value_copy(), db_value_not_empty(), hsm_key::dbo, and hsm_key_from_result().

Referenced by hsm_key_factory_release_key_id(), key_data_cache_hsm_key(), and key_data_get_hsm_key().

## hsm_key_get_by_locator()

int hsm_key_get_by_locator | ( | hsm_key_t * | hsm_key,
|  | const char * | locator )

Get a hsm key object from the database by a locator specified in locator.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.
  [in] | locator | a character pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 1155 of file hsm_key.c.

References DB_CLAUSE_EQUAL, db_clause_free(), db_clause_get_value(), db_clause_list_add(), db_clause_list_free(), db_clause_list_new(), db_clause_new(), db_clause_set_field(), db_clause_set_type(), DB_ERROR_UNKNOWN, db_object_read(), DB_OK, db_result_list_free(), db_result_list_next(), db_value_from_text(), hsm_key::dbo, and hsm_key_from_result().

Referenced by hsm_key_new_get_by_locator().

## hsm_key_id()

const db_value_t * hsm_key_id | ( | const hsm_key_t * | hsm_key | ) |

Get the id of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.

Returns
  a db_value_t pointer or NULL on error.

Definition at line 504 of file hsm_key.c.

References hsm_key::id.

Referenced by hsm_key_factory_delete_key(), hsm_key_factory_release_key(), hsm_key_factory_release_key_id(), key_data_get_by_hsm_key_id(), key_data_get_hsm_key(), key_data_hsm_key_id_clause(), key_data_new_get_by_hsm_key_id(), key_data_set_hsm_key_id(), perform_keydata_import(), and removeDeadKeysNow().

## hsm_key_inception()

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.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.

Returns
  an unsigned integer.

Definition at line 560 of file hsm_key.c.

References hsm_key::inception.

## hsm_key_is_revoked_clause()

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.

Parameters

  [in] | clause_list | db_clause_list_t pointer.
  [in] | is_revoked | an unsigned integer.

Returns
  a db_clause_t pointer to the added clause or NULL on error.

Definition at line 840 of file hsm_key.c.

References DB_CLAUSE_EQUAL, db_clause_free(), db_clause_get_value(), db_clause_list_add(), db_clause_new(), DB_CLAUSE_OPERATOR_AND, db_clause_set_field(), db_clause_set_operator(), db_clause_set_type(), and db_value_from_uint32().

Referenced by hsm_key_factory_generate(), and hsm_key_factory_get_key().

## hsm_key_key_type_clause()

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.

Parameters

  [in] | clause_list | db_clause_list_t pointer.
  [in] | key_type | a hsm_key_key_type_t.

Returns
  a db_clause_t pointer to the added clause or NULL on error.

Definition at line 861 of file hsm_key.c.

References DB_CLAUSE_EQUAL, db_clause_free(), db_clause_get_value(), db_clause_list_add(), db_clause_new(), DB_CLAUSE_OPERATOR_AND, db_clause_set_field(), db_clause_set_operator(), db_clause_set_type(), db_value_from_enum_value(), and hsm_key_enum_set_key_type.

Referenced by hsm_key_factory_generate(), and hsm_key_factory_get_key().

## hsm_key_list_begin()

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.

Parameters

  [in] | hsm_key_list | a hsm_key_list_t pointer.

Returns
  a hsm_key_t pointer or NULL on error or if there are no hsm key objects in the hsm key object list.

Definition at line 1832 of file hsm_key.c.

References db_object_connection(), db_result_list_begin(), db_result_list_size(), hsm_key_list::dbo, hsm_key_list::hsm_key, hsm_key_from_result(), hsm_key_new(), hsm_key_list::object_list, hsm_key_list::object_list_position, hsm_key_list::object_list_size, hsm_key_list::object_store, and hsm_key_list::result_list.

Referenced by hsm_key_list_get_begin().

## hsm_key_list_copy()

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.

Parameters

  [in] | hsm_key_list | a hsm_key_list_t pointer.
  [in] | from_hsm_key_list | a hsm_key_list_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

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().

## hsm_key_list_free()

void hsm_key_list_free | ( | hsm_key_list_t * | hsm_key_list | ) |

Delete a hsm key object list.

Parameters

  [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_factory_delete_key(), hsm_key_factory_get_key(), hsm_key_list_new_copy(), hsm_key_list_new_get_by_clauses(), hsm_key_list_new_get_by_policy_id(), key_data_list_free(), policy_copy(), policy_free(), and policy_import().

## hsm_key_list_get_begin()

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.

Parameters

  [in] | hsm_key_list | a hsm_key_list_t pointer.

Returns
  a hsm_key_t pointer or NULL on error or if there are no hsm key objects in the hsm key object list.

Definition at line 1888 of file hsm_key.c.

References db_object_connection(), db_result_list_begin(), hsm_key_list::dbo, hsm_key_copy(), hsm_key_free(), hsm_key_from_result(), hsm_key_list_begin(), hsm_key_new(), hsm_key_list::object_store, and hsm_key_list::result_list.

## hsm_key_list_get_by_clauses()

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.

Parameters

  [in] | hsm_key_list | a hsm_key_list_t pointer.
  [in] | clause_list | a db_clause_list_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 1684 of file hsm_key.c.

References hsm_key_list::associated_fetch, DB_ERROR_UNKNOWN, db_object_read(), DB_OK, db_result_list_fetch_all(), db_result_list_free(), hsm_key_list::dbo, hsm_key_free(), hsm_key_list::object_list, hsm_key_list::object_list_first, hsm_key_list::object_list_size, and hsm_key_list::result_list.

Referenced by hsm_key_list_new_get_by_clauses().

## hsm_key_list_get_by_policy_id()

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.

Parameters

  [in] | hsm_key_list | a hsm_key_list_t pointer.
  [in] | policy_id | a db_value_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 1746 of file hsm_key.c.

References hsm_key_list::associated_fetch, DB_CLAUSE_EQUAL, db_clause_free(), db_clause_get_value(), db_clause_list_add(), db_clause_list_free(), db_clause_list_new(), db_clause_new(), db_clause_set_field(), db_clause_set_type(), DB_ERROR_UNKNOWN, db_object_read(), DB_OK, db_result_list_fetch_all(), db_result_list_free(), db_value_copy(), db_value_not_empty(), hsm_key_list::dbo, hsm_key_free(), hsm_key_list::object_list, hsm_key_list::object_list_first, hsm_key_list::object_list_size, policy_id(), and hsm_key_list::result_list.

Referenced by hsm_key_list_new_get_by_policy_id().

## hsm_key_list_get_next()

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.

Parameters

  [in] | hsm_key_list | a hsm_key_list_t pointer.

Returns
  a hsm_key_t pointer or NULL on error or if there are no more hsm key objects in the hsm key object list.

Definition at line 1990 of file hsm_key.c.

References db_object_connection(), db_result_list_next(), hsm_key_list::dbo, hsm_key_copy(), hsm_key_free(), hsm_key_from_result(), hsm_key_list_next(), hsm_key_new(), hsm_key_list::object_store, and hsm_key_list::result_list.

Referenced by hsm_key_factory_delete_key(), and hsm_key_factory_get_key().

## hsm_key_list_new()

hsm_key_list_t * hsm_key_list_new | ( | const db_connection_t * | connection | ) |

Create a new hsm key object list.

Parameters

  [in] | connection | a db_connection_t pointer.

Returns
  a hsm_key_list_t pointer or NULL on error.

Definition at line 1453 of file hsm_key.c.

References hsm_key_list::dbo.

Referenced by hsm_key_list_new_copy(), hsm_key_list_new_get_by_clauses(), and hsm_key_list_new_get_by_policy_id().

## 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.

Parameters

  [in] | hsm_key_list | a hsm_key_list_t pointer.

Returns
  a hsm_key_list_t pointer or NULL on error.

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_new_get_by_clauses()

hsm_key_list_t * hsm_key_list_new_get_by_clauses | ( | const db_connection_t * | connection,
|  | const db_clause_list_t * | clause_list )

Get a new list of hsm key objects from the database by a clause list.

Parameters

  [in] | connection | a db_connection_t pointer.
  [in] | clause_list | a db_clause_list_t pointer.

Returns
  a hsm_key_list_t pointer or NULL on error.

Definition at line 1726 of file hsm_key.c.

References hsm_key_list_free(), hsm_key_list_get_by_clauses(), and hsm_key_list_new().

Referenced by hsm_key_factory_delete_key(), hsm_key_factory_get_key(), and hsm_key_list_new_get_by_policy_key().

## hsm_key_list_new_get_by_policy_id()

hsm_key_list_t * hsm_key_list_new_get_by_policy_id | ( | const db_connection_t * | connection,
|  | const db_value_t * | policy_id )

Get a new list of hsm key objects from the database by a policy_id specified in policy_id.

Parameters

  [in] | connection | a db_connection_t pointer.
  [in] | policy_id | a db_value_t pointer.

Returns
  a hsm_key_list_t pointer or NULL on error.

Definition at line 1809 of file hsm_key.c.

References db_value_not_empty(), hsm_key_list_free(), hsm_key_list_get_by_policy_id(), hsm_key_list_new(), and policy_id().

Referenced by policy_import().

## hsm_key_list_next()

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.

Parameters

  [in] | hsm_key_list | a hsm_key_list_t pointer.

Returns
  a hsm_key_t pointer or NULL on error or if there are no more hsm key objects in the hsm key object list.

Definition at line 1924 of file hsm_key.c.

References db_object_connection(), db_result_list_next(), db_result_list_size(), hsm_key_list::dbo, hsm_key_list::hsm_key, hsm_key_from_result(), hsm_key_new(), 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, and hsm_key_list::result_list.

Referenced by hsm_key_list_get_next(), and policy_import().

## hsm_key_list_object_store()

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.

Parameters

  [in] | hsm_key_list | a hsm_key_list_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 1486 of file hsm_key.c.

References DB_ERROR_UNKNOWN, DB_OK, and hsm_key_list::object_store.

## hsm_key_locator()

const char * hsm_key_locator | ( | const hsm_key_t * | hsm_key | ) |

Get the locator of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.

Returns
  a character pointer or NULL on error or if no locator has been set.

Definition at line 520 of file hsm_key.c.

References hsm_key::locator.

Referenced by hsm_key_factory_delete_key(), hsm_key_factory_release_key(), hsm_key_factory_release_key_id(), and removeDeadKeysNow().

## hsm_key_new()

hsm_key_t * hsm_key_new | ( | const db_connection_t * | connection | ) |

Create a new hsm key object.

Parameters

  [in] | connection | a db_connection_t pointer.

Returns
  a hsm_key_t pointer or NULL on error.

Definition at line 244 of file hsm_key.c.

References hsm_key::algorithm, hsm_key::backup, hsm_key::bits, db_value_reset(), hsm_key::dbo, HSM_KEY_BACKUP_NO_BACKUP, HSM_KEY_KEY_TYPE_RSA, HSM_KEY_ROLE_ZSK, HSM_KEY_STATE_UNUSED, hsm_key::id, hsm_key::key_type, hsm_key::policy_id, hsm_key::rev, hsm_key::role, and hsm_key::state.

Referenced by hsm_key_factory_generate(), hsm_key_factory_release_key_id(), hsm_key_list_begin(), hsm_key_list_get_begin(), hsm_key_list_get_next(), hsm_key_list_next(), hsm_key_new_copy(), hsm_key_new_get_by_locator(), key_data_cache_hsm_key(), key_data_get_hsm_key(), and perform_hsmkey_import().

## hsm_key_new_copy()

hsm_key_t * hsm_key_new_copy | ( | const hsm_key_t * | hsm_key | ) |

Create a new hsm key object that is a copy of another hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.

Returns
  a hsm_key_t pointer or NULL on error.

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_new_get_by_locator()

hsm_key_t * hsm_key_new_get_by_locator | ( | const db_connection_t * | connection,
|  | const char * | locator )

Get a new hsm key object from the database by a locator specified in locator.

Parameters

  [in] | connection | a db_connection_t pointer.
  [in] | locator | a character pointer.

Returns
  a hsm_key_t pointer or NULL on error or if it does not exist.

Definition at line 1205 of file hsm_key.c.

References hsm_key_free(), hsm_key_get_by_locator(), and hsm_key_new().

Referenced by perform_hsmkey_import(), perform_keydata_import(), and run_ds_cmd().

## hsm_key_policy_id()

const db_value_t * hsm_key_policy_id | ( | const hsm_key_t * | hsm_key | ) |

Get the policy_id of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.

Returns
  a db_value_t pointer or NULL on error.

Definition at line 512 of file hsm_key.c.

References hsm_key::policy_id.

## hsm_key_policy_id_clause()

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.

Parameters

  [in] | clause_list | db_clause_list_t pointer.
  [in] | policy_id | a db_value_t pointer.

Returns
  a db_clause_t pointer to the added clause or NULL on error.

Definition at line 729 of file hsm_key.c.

References DB_CLAUSE_EQUAL, db_clause_free(), db_clause_get_value(), db_clause_list_add(), db_clause_new(), DB_CLAUSE_OPERATOR_AND, db_clause_set_field(), db_clause_set_operator(), db_clause_set_type(), db_value_copy(), db_value_not_empty(), and policy_id().

Referenced by hsm_key_factory_generate(), and hsm_key_factory_get_key().

## hsm_key_repository()

const char * hsm_key_repository | ( | const hsm_key_t * | hsm_key | ) |

Get the repository of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.

Returns
  a character pointer or NULL on error or if no repository has been set.

Definition at line 568 of file hsm_key.c.

References hsm_key::repository.

## hsm_key_repository_clause()

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.

Parameters

  [in] | clause_list | db_clause_list_t pointer.
  [in] | repository_text | a character pointer.

Returns
  a db_clause_t pointer to the added clause or NULL on error.

Definition at line 882 of file hsm_key.c.

References DB_CLAUSE_EQUAL, db_clause_free(), db_clause_get_value(), db_clause_list_add(), db_clause_new(), DB_CLAUSE_OPERATOR_AND, db_clause_set_field(), db_clause_set_operator(), db_clause_set_type(), and db_value_from_text().

Referenced by hsm_key_factory_generate(), and hsm_key_factory_get_key().

## hsm_key_role()

hsm_key_role_t hsm_key_role | ( | const hsm_key_t * | hsm_key | ) |

Get the role of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.

Returns
  a hsm_key_role_t which may be HSM_KEY_ROLE_INVALID on error or if no role has been set.

Definition at line 552 of file hsm_key.c.

References HSM_KEY_ROLE_INVALID, and hsm_key::role.

## hsm_key_role_clause()

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.

Parameters

  [in] | clause_list | db_clause_list_t pointer.
  [in] | role | a hsm_key_role_t.

Returns
  a db_clause_t pointer to the added clause or NULL on error.

Definition at line 819 of file hsm_key.c.

References DB_CLAUSE_EQUAL, db_clause_free(), db_clause_get_value(), db_clause_list_add(), db_clause_new(), DB_CLAUSE_OPERATOR_AND, db_clause_set_field(), db_clause_set_operator(), db_clause_set_type(), db_value_from_enum_value(), and hsm_key_enum_set_role.

Referenced by hsm_key_factory_generate(), and hsm_key_factory_get_key().

## hsm_key_set_algorithm()

int hsm_key_set_algorithm | ( | hsm_key_t * | hsm_key,
|  | unsigned int | algorithm )

Set the algorithm of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.
  [in] | algorithm | an unsigned integer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 648 of file hsm_key.c.

References hsm_key::algorithm, DB_ERROR_UNKNOWN, and DB_OK.

Referenced by hsm_key_factory_generate(), and perform_hsmkey_import().

## hsm_key_set_backup()

int hsm_key_set_backup | ( | hsm_key_t * | hsm_key,
|  | hsm_key_backup_t | backup )

Set the backup of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.
  [in] | backup | a hsm_key_backup_t.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 716 of file hsm_key.c.

References hsm_key::backup, DB_ERROR_UNKNOWN, DB_OK, and HSM_KEY_BACKUP_INVALID.

Referenced by hsm_key_factory_generate().

## hsm_key_set_bits()

int hsm_key_set_bits | ( | hsm_key_t * | hsm_key,
|  | unsigned int | bits )

Set the bits of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.
  [in] | bits | an unsigned integer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 638 of file hsm_key.c.

References hsm_key::bits, DB_ERROR_UNKNOWN, and DB_OK.

Referenced by hsm_key_factory_generate(), and perform_hsmkey_import().

## hsm_key_set_inception()

int hsm_key_set_inception | ( | hsm_key_t * | hsm_key,
|  | unsigned int | inception )

Set the inception of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.
  [in] | inception | an unsigned integer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 671 of file hsm_key.c.

References DB_ERROR_UNKNOWN, DB_OK, and hsm_key::inception.

Referenced by hsm_key_factory_generate(), and perform_hsmkey_import().

## hsm_key_set_key_type()

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.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.
  [in] | key_type | a hsm_key_key_type_t.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

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.

Referenced by hsm_key_factory_generate(), and perform_hsmkey_import().

## hsm_key_set_locator()

int hsm_key_set_locator | ( | hsm_key_t * | hsm_key,
|  | const char * | locator_text )

Set the locator of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.
  [in] | locator_text | a character pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 603 of file hsm_key.c.

References DB_ERROR_UNKNOWN, DB_OK, and hsm_key::locator.

Referenced by hsm_key_factory_generate(), and perform_hsmkey_import().

## hsm_key_set_policy_id()

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.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.
  [in] | policy_id | a db_value_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

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().

Referenced by hsm_key_factory_generate(), and perform_hsmkey_import().

## hsm_key_set_repository()

int hsm_key_set_repository | ( | hsm_key_t * | hsm_key,
|  | const char * | repository_text )

Set the repository of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.
  [in] | repository_text | a character pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 694 of file hsm_key.c.

References DB_ERROR_UNKNOWN, DB_OK, and hsm_key::repository.

Referenced by hsm_key_factory_generate(), and perform_hsmkey_import().

## hsm_key_set_role()

int hsm_key_set_role | ( | hsm_key_t * | hsm_key,
|  | hsm_key_role_t | role )

Set the role of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.
  [in] | role | a hsm_key_role_t.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 658 of file hsm_key.c.

References DB_ERROR_UNKNOWN, DB_OK, HSM_KEY_ROLE_INVALID, and hsm_key::role.

Referenced by hsm_key_factory_generate(), and perform_hsmkey_import().

## hsm_key_set_state()

int hsm_key_set_state | ( | hsm_key_t * | hsm_key,
|  | hsm_key_state_t | state )

Set the state of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.
  [in] | state | a hsm_key_state_t.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 625 of file hsm_key.c.

References DB_ERROR_UNKNOWN, DB_OK, HSM_KEY_STATE_INVALID, and hsm_key::state.

Referenced by hsm_key_factory_generate(), hsm_key_factory_get_key(), hsm_key_factory_release_key(), hsm_key_factory_release_key_id(), and perform_hsmkey_import().

## hsm_key_state()

hsm_key_state_t hsm_key_state | ( | const hsm_key_t * | hsm_key | ) |

Get the state of a hsm key object.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.

Returns
  a hsm_key_state_t which may be HSM_KEY_STATE_INVALID on error or if no state has been set.

Definition at line 528 of file hsm_key.c.

References HSM_KEY_STATE_INVALID, and hsm_key::state.

## hsm_key_state_clause()

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.

Parameters

  [in] | clause_list | db_clause_list_t pointer.
  [in] | state | a hsm_key_state_t.

Returns
  a db_clause_t pointer to the added clause or NULL on error.

Definition at line 756 of file hsm_key.c.

References DB_CLAUSE_EQUAL, db_clause_free(), db_clause_get_value(), db_clause_list_add(), db_clause_new(), DB_CLAUSE_OPERATOR_AND, db_clause_set_field(), db_clause_set_operator(), db_clause_set_type(), db_value_from_enum_value(), and hsm_key_enum_set_state.

Referenced by hsm_key_factory_delete_key(), hsm_key_factory_generate(), and hsm_key_factory_get_key().

## hsm_key_update()

int hsm_key_update | ( | hsm_key_t * | hsm_key | ) |

Update a hsm key object in the database.

Parameters

  [in] | hsm_key | a hsm_key_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 1225 of file hsm_key.c.

References hsm_key::algorithm, hsm_key::backup, hsm_key::bits, DB_CLAUSE_EQUAL, db_clause_free(), db_clause_get_value(), db_clause_list_add(), db_clause_list_free(), db_clause_list_new(), db_clause_new(), db_clause_set_field(), db_clause_set_type(), DB_ERROR_UNKNOWN, db_object_field_free(), db_object_field_list_add(), db_object_field_list_free(), db_object_field_list_new(), db_object_field_new(), db_object_field_set_enum_set(), db_object_field_set_name(), db_object_field_set_type(), db_object_update(), DB_TYPE_ANY, DB_TYPE_ENUM, DB_TYPE_TEXT, DB_TYPE_UINT32, db_value_copy(), db_value_from_enum_value(), db_value_from_text(), db_value_from_uint32(), db_value_not_empty(), db_value_set_free(), db_value_set_get(), db_value_set_new(), hsm_key::dbo, hsm_key_enum_set_backup, hsm_key_enum_set_key_type, hsm_key_enum_set_role, hsm_key_enum_set_state, hsm_key::id, hsm_key::inception, hsm_key::is_revoked, hsm_key::key_type, hsm_key::locator, hsm_key::policy_id, hsm_key::repository, hsm_key::rev, hsm_key::role, and hsm_key::state.

Referenced by hsm_key_factory_get_key(), hsm_key_factory_release_key(), and hsm_key_factory_release_key_id().

## Variable Documentation

## hsm_key_enum_set_backup

const db_enum_t hsm_key_enum_set_backup[]

Initial value:
= {
{ "Not Required", (hsm_key_backup_t)HSM_KEY_BACKUP_NO_BACKUP },
{ "Required", (hsm_key_backup_t)HSM_KEY_BACKUP_BACKUP_REQUIRED },
{ "Prepared", (hsm_key_backup_t)HSM_KEY_BACKUP_BACKUP_REQUESTED },
{ "Done", (hsm_key_backup_t)HSM_KEY_BACKUP_BACKUP_DONE },
{ NULL, 0 }
}
hsm_key_backup_t
enum hsm_key_backup hsm_key_backup_t
HSM_KEY_BACKUP_BACKUP_REQUESTED
@ HSM_KEY_BACKUP_BACKUP_REQUESTED
Definition hsm_key.h:68
HSM_KEY_BACKUP_NO_BACKUP
@ HSM_KEY_BACKUP_NO_BACKUP
Definition hsm_key.h:66
HSM_KEY_BACKUP_BACKUP_DONE
@ HSM_KEY_BACKUP_BACKUP_DONE
Definition hsm_key.h:69
HSM_KEY_BACKUP_BACKUP_REQUIRED
@ HSM_KEY_BACKUP_BACKUP_REQUIRED
Definition hsm_key.h:67

Definition at line 56 of file hsm_key.c.

Referenced by hsm_key_backup_clause(), hsm_key_create(), hsm_key_from_result(), hsm_key_to_backup_state(), and hsm_key_update().

## hsm_key_enum_set_key_type

const db_enum_t hsm_key_enum_set_key_type[]

Initial value:
= {
{ "RSA", (hsm_key_key_type_t)HSM_KEY_KEY_TYPE_RSA },
{ NULL, 0 }
}
hsm_key_key_type_t
enum hsm_key_key_type hsm_key_key_type_t
HSM_KEY_KEY_TYPE_RSA
@ HSM_KEY_KEY_TYPE_RSA
Definition hsm_key.h:61

Definition at line 51 of file hsm_key.c.

Referenced by hsm_key_create(), hsm_key_from_result(), hsm_key_key_type_clause(), and hsm_key_update().

## hsm_key_enum_set_role

const db_enum_t hsm_key_enum_set_role[]

Initial value:
= {
{ "KSK", (hsm_key_role_t)HSM_KEY_ROLE_KSK },
{ "ZSK", (hsm_key_role_t)HSM_KEY_ROLE_ZSK },
{ "CSK", (hsm_key_role_t)HSM_KEY_ROLE_CSK },
{ NULL, 0 }
}
hsm_key_role_t
enum hsm_key_role hsm_key_role_t
HSM_KEY_ROLE_KSK
@ HSM_KEY_ROLE_KSK
Definition hsm_key.h:51
HSM_KEY_ROLE_ZSK
@ HSM_KEY_ROLE_ZSK
Definition hsm_key.h:52
HSM_KEY_ROLE_CSK
@ HSM_KEY_ROLE_CSK
Definition hsm_key.h:53

Definition at line 44 of file hsm_key.c.

Referenced by hsm_key_create(), hsm_key_from_result(), hsm_key_role_clause(), and hsm_key_update().

## hsm_key_enum_set_state

const db_enum_t hsm_key_enum_set_state[]

Initial value:
= {
{ "UNUSED", (hsm_key_state_t)HSM_KEY_STATE_UNUSED },
{ "PRIVATE", (hsm_key_state_t)HSM_KEY_STATE_PRIVATE },
{ "SHARED", (hsm_key_state_t)HSM_KEY_STATE_SHARED },
{ "DELETE", (hsm_key_state_t)HSM_KEY_STATE_DELETE },
{ NULL, 0 }
}
hsm_key_state_t
enum hsm_key_state hsm_key_state_t
HSM_KEY_STATE_UNUSED
@ HSM_KEY_STATE_UNUSED
Definition hsm_key.h:42
HSM_KEY_STATE_PRIVATE
@ HSM_KEY_STATE_PRIVATE
Definition hsm_key.h:43
HSM_KEY_STATE_SHARED
@ HSM_KEY_STATE_SHARED
Definition hsm_key.h:44
HSM_KEY_STATE_DELETE
@ HSM_KEY_STATE_DELETE
Definition hsm_key.h:45

Definition at line 36 of file hsm_key.c.

Referenced by hsm_key_create(), hsm_key_from_result(), hsm_key_state_clause(), and hsm_key_update().