If the encrypted data is stored on a hard drive in that safe, the government <i>can</i> compel production in some cases, blocked mainly by a legal quirk involving the Fifth Amendment:<p><a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Key_disclosure_law#United_States" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Key_disclosure_law#United_St...</a><p>IANAL, but I think your original hypothetical would be roughly analogous.  I think the difference in this Apple case is essentially the amount of effort required (producing a password versus actually writing [a modicum of] new OS software), but I could be wrong.