1

My question is identical to Import certificates into the System Keychain via the command line except I need a way to get an existing certificate in the form of a crt file via terminal.

notacorn
  • 121

1 Answers1

1

You can search for certificates in pem format (which is the same thing as what's in the crt file) using the security module:

% security find-certificate -c RCA -p
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----

In this example I'm searching for a certificate that matches the pattern "RCA".

Once you have this stdout you can use it as you wish.

notacorn
  • 121