Function anj_security_get_psk_info

Function Documentation

int anj_security_get_psk_info(const anj_t *anj, bool bootstrap_credentials, anj_net_psk_info_t *out_psk_info)

Retrieves the Pre-Shared Key (PSK) identity and key for the specified connection.

This function may be used both internally by the library and by user code that needs access to credentials associated with the Security Object, for example to configure transport security for firmware download.

Credential data is provided by callbacks registered using anj_security_register_credential_handlers.

Note

Anjay Lite supports only one non-Bootstrap Server LwM2M Server.

Parameters:
  • anj – Anjay object.

  • bootstrap_credentials – If true, retrieves credentials for the Bootstrap Server, otherwise for the regular LwM2M Server.

  • out_psk_info[out] Output parameter for the PSK-based security information.

Returns:

0 in case of success, negative value in case of error.