If you restrict such uses, that's incompatible with Article 6 of the Open Source Definition: https://opensource.org/osd
For your driver's license, it's also completely unnecessary. A digital driver's license is a bunch of data signed by a government key. If I modify the data, the signature will no longer match. But I can modify an app using the driver's license in any way without compromising the security of the system. There's no reason why such a driver's license app must be attested to be unmodified.