The Court of Appeals for the Armed Forces (CAAF) has not yet ruled on whether passcodes or biometric identification (fingerprint or facial recognition) are testimonial and therefore protected by the Fifth Amendment. More important, neither has the Supreme Court of the United States. CAAF recently decided the case of *Mitchell* which could have dealt with whether a passcode is testimonial, but instead they were able to dispose of the case on the narrower grounds that the accused had asked for a lawyer and so he should not have been asked for his passcode after that request.
In the civilian world, whether there is a difference between a passcode and biometric methods for Fifth Amendment purposes is probably no longer relevant. Both iPhones and most Android phones today will lock out biometric methods and require a passcode after a certain period of time (usually 48 hours). Obviously a court order will usually take much longer than that so for all practical purposes, the real question deals with passcodes. The military is different. In the military a commander could order a service member to unlock their phone (by any method) and do it quickly. So what should that service member do?
I cannot ethically advise a service member to violate a lawful order (in violation of Article 92, UCMJ). But the question remains, is that a lawful order. Personally, I believe that the act of decrypting an encrypted device (such as a cellphone or computer) is inherently testimonial and therefore protected by the Fifth Amendment right against self-incrimination. And this goes for both passcodes and biometric methods such as fingerprint or facial recognition. So I personally do not believe that to be a lawful order. However, the courts may end up disagreeing with me on the lawfulness of that order. (I note for informational purposes that in most cases the violation of a specific order to unlock a device would have a maximum penalty of six months in prison and a bad conduct discharge, in some cases the maximum would be as high as 2 years in prison and a dishonorable discharge. In most cases, service members under investigation for an offense will be facing a maximum of much longer than two years.)
What I do recommend is that a service member being asked to unlock a device should absolutely deny that request (along with every other request from law enforcement) and ask to speak to a lawyer. If the service member receives an order to unlock, they should ask to speak to a lawyer first. I can’t guarantee that this will protect you from being charged with violating an order, but in an unsettled area of law it should be reasonable to ask to get a lawyer’s opinion.