The trust command

trust is the trust store's operator command. It reads over trustd's socket and writes to the registry, and the asymmetry is worth understanding: only trustd knows the effective set, because the shipped roots are package data rather than registry entries, so a listing read from the registry would show a handful of local decisions and none of the hundred and fifty roots actually in force. Writes go the other way, to the registry, so that trust and reg pass through the same access check.

Verbs #

CommandReadsWrites
trust list [--purpose P]socket
trust list --distrustedregistry
trust show <fingerprint> [--pem]socket
trust statussocket
trust add <name> <file|-> [--purposes A,B]the fileregistry
trust remove <name>registry
trust distrust <fingerprint|file> [--reason R]socket, thenregistry
trust restore <fingerprint>registryregistry
trust reload— (asks trustd to recompose)

Listing #

$ trust list
018e13f0772532cf  shipped    CN=DigiCert TLS ECC P384 Root G5,O=DigiCert\, Inc.,C=US
0a81ec5a929777f1  shipped    CN=GlobalSign,O=GlobalSign,OU=GlobalSign Root CA - R3
4f2ab19c8e10dd77  added:corp-ca  CN=Corp Issuing CA,O=Example Ltd,C=GB

121 root(s)

The first column is the first sixteen characters of the SHA-256 fingerprint, and every verb that takes a fingerprint accepts that prefix — what is printed can be pasted back in. An ambiguous prefix is refused rather than guessed at.

--purpose ServerAuth narrows the listing to roots carrying that purpose.

Showing one root #

$ trust show 4f2ab19c
subject      CN=Corp Issuing CA,O=Example Ltd,C=GB
fingerprint  4f2ab19c8e10dd77…
source       added
added as     corp-ca
purposes     ServerAuth
expires      2074003199

-----BEGIN CERTIFICATE-----
…

--pem prints the certificate alone, for piping into a file or another tool.

Exit statuses #

StatusMeaning
0Done.
2Asked about something that is not there — no root matches, no such addition, not distrusted.
1It went wrong: the daemon is unreachable, the file is not a certificate, the registry refused the write.
64The command line was not understood.

The separation of 2 from 1 is what lets a script tell "this machine does not trust that CA" from "I could not find out".

When a write is refused #

$ trust distrust 018e13f0772532cf
trust: not permitted to change Machine\System\Trust\Certificates\Distrust —
       changing what this machine trusts is governed by that key's descriptor

trust has no privilege of its own to grant. Changing the machine's trust is a registry write, and whether you may make it is decided by the key's security descriptor — the same answer reg would get.

Edit this page