49#ifdef COAP_DTLS_PSK_DEFAULT_IDENTITY
50#ifdef COAP_DTLS_PSK_DEFAULT_KEY
53get_default_psk_info(
const coap_endpoint_t *address_info,
61 if(info->identity == NULL || info->identity_len == 0) {
63 info->identity = (uint8_t *)COAP_DTLS_PSK_DEFAULT_IDENTITY;
64 info->identity_len = strlen(COAP_DTLS_PSK_DEFAULT_IDENTITY);
69 if(info->identity_len != strlen(COAP_DTLS_PSK_DEFAULT_IDENTITY) ||
70 memcmp(info->identity, COAP_DTLS_PSK_DEFAULT_IDENTITY,
71 info->identity_len) != 0) {
77 info->key = (uint8_t *)COAP_DTLS_PSK_DEFAULT_KEY;
78 info->key_len = strlen(COAP_DTLS_PSK_DEFAULT_KEY);
83 .coap_get_psk_info = get_default_psk_info
89#ifdef COAP_DTLS_TEST_CA_CERT
90#ifdef COAP_DTLS_TEST_OWN_CERT
91#ifdef COAP_DTLS_TEST_PRIV_KEY
94get_default_cert_info(
const coap_endpoint_t *address_info,
101 info->ca_cert = (uint8_t *)COAP_DTLS_TEST_CA_CERT;
102 info->ca_cert_len =
sizeof(COAP_DTLS_TEST_CA_CERT);
104 info->own_cert = (uint8_t *)COAP_DTLS_TEST_OWN_CERT;
105 info->own_cert_len =
sizeof(COAP_DTLS_TEST_OWN_CERT);
107 info->priv_key = (uint8_t *)COAP_DTLS_TEST_PRIV_KEY;
108 info->priv_key_len =
sizeof(COAP_DTLS_TEST_PRIV_KEY);
113 .coap_get_cert_info = get_default_cert_info
125#if (defined(COAP_DTLS_PSK_DEFAULT_IDENTITY) \
126 && defined(COAP_DTLS_PSK_DEFAULT_KEY)) \
127 || (defined(COAP_DTLS_TEST_CA_CERT) \
128 && defined(COAP_DTLS_TEST_OWN_CERT) \
129 && defined(COAP_DTLS_TEST_PRIV_KEY))
API to address CoAP endpoints.
void coap_keystore_simple_init(void)
Registers a simple CoAP DTLS keystore with fixed pre-shared key credentials.
void coap_set_keystore(const coap_keystore_t *keystore)
Set the CoAP keystore to use by CoAP.
The structure of a CoAP PKI certificate info.
The structure of a CoAP pre-shared key info.
The structure of a CoAP keystore.