Error when running security in Terminal

You probably copied/pasted the example listed in the man page, which actually is supposed to show how security can be run interactively. To fix, you can do one of the following:

  • Run in interactive mode by executing security -i in Terminal and then just entering export -k SystemCACertificates.keychain -t all -f openssl -o goodone.txt when you get the security> prompt
  • Run security export -k SystemCACertificates.keychain -t all -f openssl -o goodone.txt from the shell