They can demand that you open the locked bag to let them inspect the ipad (or anything else), but the good part of your plan is that they will have to wait until you have been processed through the rest of your screening. This severely limits their chance to do something sneaky since you can pay attention to them instead of being groped or irradiated.