keychain.sh 669 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env sh
  2. ######## Public functions #####################
  3. #domain keyfile certfile cafile fullchain
  4. keychain_deploy() {
  5. _cdomain="$1"
  6. _ckey="$2"
  7. _ccert="$3"
  8. _cca="$4"
  9. _cfullchain="$5"
  10. _debug _cdomain "$_cdomain"
  11. _debug _ckey "$_ckey"
  12. _debug _ccert "$_ccert"
  13. _debug _cca "$_cca"
  14. _debug _cfullchain "$_cfullchain"
  15. /usr/bin/security import "$_ckey" -k "/Library/Keychains/System.keychain"
  16. /usr/bin/security import "$_ccert" -k "/Library/Keychains/System.keychain"
  17. /usr/bin/security import "$_cca" -k "/Library/Keychains/System.keychain"
  18. /usr/bin/security import "$_cfullchain" -k "/Library/Keychains/System.keychain"
  19. return 0
  20. }