Find trust setting of a login keychain using cmd

Solution 1:

So found the problem

Problem: I installed the certs using security add-trusted-cert -d -r trustAsRoot -k $HOME/Library/Keychains/login.keychain-db path/to/certs/ca.pem

-d flag in the above command was adding the certs to admin cert store. Which isn't detected in the security dump-trust-settings command.

Solution: Removing the -d flag fixed the problem while saving certs fixed the problem.

PS: security dump-trust-settings actually returns the certs trust settings from local keychain if it either marked as trusted or not trusted. It doesn't return the certs if it's trust settings are marked as system defaults

enter image description here