List Valid Code-Signing Identities with security find-identity

Show every valid signing certificate + private key pair your keychain can offer to codesign.

macOSKeychaincertificatescodesignsecurityMedium risk
Run security find-identity -v -p codesigning — valid identities print as a numbered list with their SHA-1 hash and name (e.g. 'Apple Development: you@example.com').

01Command

Command
$ security find-identity -v -p codesigning

02What it does

An identity is a certificate together with its private key; a certificate without the key does not appear in this list. The -p codesigning policy filter keeps only identities usable for code signing and -v hides invalid/expired ones, which is exactly what xcodebuild and codesign look for. The leading hash is what you pass to codesign -s <hash>.

03Risk

RiskMedium risk
!Warning: If the list is empty, either the certificate was never installed or the private key is missing (common when only the .cer was imported) — check Keychain Access.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • security - Administer Keychains, Keys, Certificates
    SS64 · technical · 2026-09-17
    Evidence: Documents the find-identity subcommand — find an identity (certificate + private key) — among the security tool's operations.
  • security(1) man page
    Xcode Man Pages · technical · 2026-09-17
    Evidence: The security man page details find-identity options: -p to specify the policy (e.g. codesigning) and -v to show only valid identities.

Last verified: 2026-09-19 · Category: Security & Privacy

06Related solutions