Estonia has been doing this for a long time now with their ID cards. It can be extended to sim-based (mobile ID) or device/app based (smart ID) key pairs as well.
It's not just for the citizens but all residency cards and e-residency works this way, too.
It's not just for the citizens but all residency cards and e-residency works this way, too.