Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

The Apple keychain application will not let you remove system roots, it will only allow you to disable them. It will only allow you to disable them one at a time. For each one, you need to go through 3 UI panels and type your password. Is there a way to either automate this or do it all at once? I do not like Apple's current selection of system roots.

share|improve this question
    
I can't give you an answer/solution, but I can suggest you re-think this. What do you hope to accomplish/What is your goal? What are the advantages of doing this? What are the disadvantages of doing this? If it is just a matter of wanting to clean up Keychain, I'd forget it. Altering ANYTHING dealing with "system" can lead to problems, and is generally not recommended. It's one of those "if it ain't broke, don't fix it" situations. –  modelamac Sep 10 '11 at 11:29
3  
My goal is to remove trusted roots from organizations that I don't trust. I do not trust the government of China. I don't trust the compromised certs from the Netherlands. I don't trust certs from a whole bunch of other organizations. I don't want them. Why should I trust all of those organizations? I don't. –  vy32 Sep 10 '11 at 20:54
1  
I'm looking to find/develop a good list of certs not to trust, and their hashes, which would be handy for distrusting 'em. Seems to me like a good idea to distrust ones not seen regularly outside specialized niches. Maybe netcraft has a list of widely used CAs developed via their survey to determine which are widely used. I'm betting that with around a dozen CAs, I'd have the top 500 sites and all the sites I visit regularly covered. vy32, I'm curious if you have your list of certs you decided not to trust, and why you selected them. Can you share? Also, –  MrE Apr 30 '12 at 23:02
    
How do you find out which certificate belongs to which application? –  Buscar웃 May 17 '13 at 15:31
    
Certificates don't belong to applications. They belong to the system. –  vy32 May 17 '13 at 22:39

1 Answer 1

up vote 6 down vote accepted

Backup keychain before trying anything.

Listing root certificates:

sudo security dump-keychain /System/Library/Keychains/SystemRootCertificates.keychain

Just look in a dump for a names or SHA-1 hash values of certificates that you want to get rid of and write them down.

Now you can delete that root certificates using security delete-certificate command.

Usage: delete-certificate [-c name] [-Z hash] [-t] [keychain...]

-c  Specify certificate to delete by its common name
-Z  Specify certificate to delete by its SHA-1 hash value
-t  Also delete user trust settings for this certificate The certificate to be deleted must be uniquely specified either by a

string found in its common name, or by its SHA-1 hash. If no keychains are specified to search, the default search list is used.

For example you can delete chinese root certificates using this command:

sudo security delete-certificate -Z 8BAF4C9B1DF02A92F7DA128EB91BACF498604B6F /System/Library/Keychains/SystemRootCertificates.keychain
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.