The police often ask for pins and passwords when seizing a smartphone on a court order or when seizing a smartphone. Do not say anything. Do not unlock anything. Contact a lawyer.
More information
You should also not react if you receive a letter from the police asking you to hand over your PIN. The police may also try to put you under verbal pressure. They may tell you that giving them your password will mitigate your punishment. Or they may tell you that you will get your phone back more quickly. Or they claim that it can be expensive for you to have your smartphone cracked professionally. Stand firm and refuse to hand it over! If in doubt, contact a lawyer.
Please bear in mind that your phone may be searched when you enter other countries such as the USA or China. You may be forced to hand over your password. In this case, you can take a freshly reset phone with you that can be safely searched. Reinstall all apps after crossing the border.