Hi sssemil,
there is currently no example for CoAP with DTLS in upstream RIOT. As far as I know, my dev branch you posted is currently the only working gcoap-DTLS branch.
In my branch the gcoap example is already adapted, so you only have to set GCOAP_ENABLE_DTLS
to 1. It should work fine so far (if not please inform me about issues), but it is not 100% ready yet.
I hope to update the related pull request very soon. Primarily I am still missing the access to the DTLS epoch to complete it. Nevertheless: coap messaging and observable resources should work.
If you just want to use nanocoap: There is an example for using the nanocoap_server . But it seems that it is just a very basic coap server.
You would need to integrate dtls here. Should be fairly easy if session management is not taken into account.
If you have any problems or questions just ask, I will do my best to help you 