If a password is considered testimony and protected by the 5th Amendment, software also appears to be testimony and covered by the same. If not, then software is just speech and protected by the 1st Amendment. Not speaking is then a valid choice seeing as to how this is not testimony and one is not compelled to speak by the court. But this is just theoretical...
This is a criminal case, however. It would apply to real people, but likely does not apply to corporations regardless of rulings treating corporations as people for other purpose. I imagine the Apple lawyers would have had it as part of their defense strategy if it did.