Password controlled iphone erase application? At present you can set your phone to erase when the correct password is not entered N times in a row.  10 I think by default.

Is there a way to configure an immediate erase?  E.g.

My unlock code is 1234, my erase code is 4321.

So if I am fumble fingered and type 2468 I get try again

but if the border crossing asks me for my password, I tell them 4321 and the phone immediately starts to erase.
Currently there is no feature for this in iOS. For an improvement over the erase after 10 incorrect passcodes, you can use Apple Configurator to set this to a number between 2 and 10.

                                

I haven't been able to find a way to do this with jailbreaking either, since there doesn't seem to be any actions or such to use the Erase Content and Settings option, however you could set up an Activator action to run a variety of ‘rm’ commands such as rm -rf /private/var/mobile which may be suitable depending on what you are going for.