When an app wants an admin password or Full Disk Access, I want to know who actually made it. The name in the menu bar can say anything; the code signature can’t. codesign ships with every Mac and reads it for you.
To see the signature details:
codesign -dv --verbose=4 /Applications/SomeApp.app
The lines I look at are the Authority lines, which show the certificate chain from the developer’s certificate up to Apple, and TeamIdentifier, the developer’s team ID. That ID stays the same across all apps from one developer, so it’s a good way to check that an update really comes from the same people as the version you had.
codesign writes this info to standard error, so to filter it you redirect that first:
codesign -dv --verbose=4 /Applications/SomeApp.app 2>&1 | grep -E 'Authority|TeamIdentifier'
If you also want to know whether the app was changed after it was signed, the man page has a verify mode. Without other output it stays quiet on success, so add --verbose:
codesign --verify --verbose /Applications/SomeApp.app
The caveat: a valid signature tells you who signed it, not whether the app is trustworthy. A developer can sign junk too. And plenty of command-line tools and scripts aren’t signed at all, so a missing signature on a Homebrew binary is less alarming than on an app that asks for your password.
Further reading: codesign man page, App code signing process in Apple Platform Security