According to an investigative report by
New Zealand's 1 news, airport customs officials routinely force up to two travelers each day to give up their electronic devices and passwords for searching. According to the customs agents, the program is designed to look for smugglers by performing a "digital strip search" on the phones and laptops of travelers. This does not require a court order, but the agents do claim to adhere to New Zealand's privacy act.
The searches can be quick or much more extensive depending on the level of danger perceived. One traveler was stopped for five hours and claims he was "made to feel like a terrorist" on his way home from Bali. Agents typically just peruse the data looking for any red flags but they have admitted to also copying it and passing it along to the government and police. According to the customs general manager, agents can seize travelers' devices at any moment and they have tools to break some types of encryption if it is encountered.