Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

security: add trusted cert add/remove examples #8250

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions pages/osx/security.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
# security

> Administer Keychains, keys, certificates and the Security framework.
> Administer keychains, keys, certificates and the Security framework.
> More information: <https://ss64.com/osx/security.html>.

- List the available keychains:
- List all available keychains:

`security list-keychains`

- Delete a specific keychain:

`security delete-keychain {{path}}`
`security delete-keychain {{path/to/file.keychain}}`

- Create a keychain:

`security create-keychain -p {{password}} {{keychain.name}}`
`security create-keychain -p {{password}} {{path/to/file.keychain}}`

- Set a certificate to use with a website or [s]ervice by its [c]ommon name (fails if several certificates with the same common name exist):

`security set-identity-preference -s {{URL|hostname|service}} -c "{{common_name}}" {{path/to/file.keychain}}`

- Add a certificate from file to a [k]eychain (if -k isn't specified, the default keychain is used):

`security add-certificates -k {{keychain.name}} {{path/to/file.pem}}`
`security add-certificates -k {{keychain.name}} {{path/to/cert.pem}}`

- Add a CA certificate to the per-user Trust Settings:

`security add-trusted-cert -k {{path/to/user-keychain.keychain-db}} {{path/to/ca-cert.pem}}`

- Remove a CA certificate from the per-user Trust Settings:

`security remove-trusted-cert {{path/to/ca-cert.pem}}`