Germans, and another countries, can soon use their iPhones as virtual ID cards

Idle question from an idle fellow.

Will the phone have to be unlocked for this to work?

If it does and you hand your phone to a Govt agent does that give them permission to look through all of it?