Doesn't the matrix chat app allow for this? Might be useful to learn how they do it if this is of interest.
https://matrix.org/docs/guides/end-to-end-encryption-impleme...