Function add_namespace_admins

Source
fn add_namespace_admins(
    nethsm: &NetHsm,
    admin_credentials: &AdminCredentials,
) -> Result<(), Error>
Expand description

Sets up all N-Administrators and their respective namespaces.

§Note

This function uses the nethsm with the default R-Administrator, but may switch to a namespace-specific N-Administrator for individual operations. If this function succeeds, the nethsm is guaranteed to use the default R-Administrator again. If this function fails, the nethsm may still use a namespace-specific N-Administrator.

§Errors

Returns an error if

  • user information cannot be retrieved from the nethsm,
  • the available namespaces cannot be retrieved from the nethsm,
  • one of the N-Administrators in the admin_credentials is not in a namespace,
  • a namespace exists already, but no known N-Administrator is available for it,
  • an N-Administrator and its namespace exist already, but that user’s passphrase cannot be set,
  • an N-Administrator does not yet exist and cannot be added,
  • a namespace does not yet exist and cannot be added,
  • or switching back to the default R-Administrator credentials fails.