BLE pairing on nRF52DK

I’m having trouble getting a secure BLE connection with the nRF52DK. I’m using the mynewt nimble stack which is included in RIOT. So far I’ve got a simple application where I can read and write to the GATT characteristics I’ve defined, but now I’d like to make that more secure by requiring the devices to be paired. I’ve tried this by adding the flags ‘BLE_GATT_CHR_F_READ_ENC’ and ‘BLE_GATT_CHR_F_WRITE_ENC’ to the characteristics that should be read from or written to, but as soon as I try to read or write to one of these characteristics using nRF connect, the connection just disconnects. Is there any example or documentation available that I can use to properly implement this?