Skip to main content

is_binary_signed

Function is_binary_signed 

Source
pub fn is_binary_signed() -> bool
Expand description

Returns true iff the current binary is considered “signed” for identity purposes.

Detection logic:

  1. If the exe path contains /target/ or \target\, it’s a cargo build → unsigned.
  2. On macOS: runs codesign --verify --no-strict — exit 0 means signed.
  3. On other platforms: if not in /target/, assumed signed (there’s no platform-equivalent ACL coupling concern on Windows/Linux, but we still separate namespaces for development builds).

Result is cached for the process lifetime.