_security 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #compdef security
  2. local -a _1st_arguments
  3. _1st_arguments=(
  4. 'help:Show all commands, or show usage for a command'
  5. 'list-keychains:Display or manipulate the keychain search list'
  6. 'default-keychain:Display or set the default keychain'
  7. 'login-keychain:Display or set the login keychain'
  8. 'create-keychain:Create keychains and add them to the search list'
  9. 'delete-keychain:Delete keychains and remove them from the search list'
  10. 'lock-keychain:Lock the specified keychain'
  11. 'lock-keychain:Unlock the specified keychain'
  12. 'set-keychain-settings:Set settings for a keychain'
  13. 'set-keychain-password:Set password for a keychain'
  14. 'show-keychain-info:Show the settings for keychain'
  15. 'dump-keychain:Dump the contents of one or more keychains'
  16. 'create-keypair:Create an asymmetric key pair'
  17. 'add-generic-password:Add a generic password item'
  18. 'add-internet-password:Add an internet password item'
  19. 'add-certificates:Add certificates to a keychain'
  20. 'find-generic-password:Find a generic password item'
  21. 'delete-generic-password:Delete a generic password item'
  22. 'find-internet-password:Find an internet password item'
  23. 'delete-internet-password:Delete an internet password item'
  24. 'find-certificate:Find a certificate item'
  25. 'find-identity:Find an identity certificate + private key'
  26. 'delete-certificate:Delete a certificate from a keychain'
  27. 'set-identity-preference:Set the preferred identity to use for a service'
  28. 'get-identity-preference:Get the preferred identity to use for a service'
  29. 'create-db:Create a db using the DL'
  30. 'export:Export items from a keychain'
  31. 'import:Import items into a keychain'
  32. 'cms:Encode or decode CMS messages'
  33. 'install-mds:MDS database'
  34. 'add-trusted-cert:Add trusted certificates:'
  35. 'remove-trusted-cert:Remove trusted certificates:'
  36. 'dump-trust-settings:Display contents of trust settings'
  37. 'user-trust-settings-enable:Display or manipulate user-level trust settings'
  38. 'trust-settings-export:Export trust settings'
  39. 'trust-settings-import:Import trust settings'
  40. 'verify-cert:Verify certificates:'
  41. 'authorize:Perform authorization operations'
  42. 'authorizationdb:Make changes to the authorization policy database'
  43. 'execute-with-privileges:Execute tool with privileges'
  44. 'leaks:Run /usr/bin/leaks on this process'
  45. 'error:Display a descriptive message for the given error codes:'
  46. 'create-filevaultmaster-keychain:"Create a keychain containing a key pair for FileVault recovery use'
  47. )
  48. _arguments '*:: :->command'
  49. if (( CURRENT == 1 )); then
  50. _describe -t commands "security command" _1st_arguments
  51. return
  52. fi
  53. case "$words[1]" in
  54. find-(generic|internet)-password)
  55. _values \
  56. 'Usage: find-[internet/generic]-password [-a account] [-s server] [options...] [-g] [keychain...]' \
  57. '-a[Match "account" string]' \
  58. '-c[Match "creator" (four-character code)]' \
  59. '-C[Match "type" (four-character code)]' \
  60. '-D[Match "kind" string]' \
  61. '-G[Match "value" string (generic attribute)]' \
  62. '-j[Match "comment" string]' \
  63. '-l[Match "label" string]' \
  64. '-s[Match "service" string]' \
  65. '-g[Display the password for the item found]' \
  66. '-w[Display only the password on stdout]' ;;
  67. add-(generic|internet)-password)
  68. _values \
  69. 'Usage: add-[internet/generic]-password [-a account] [-s server] [-w password] [options...] [-A|-T appPath] [keychain]]' \
  70. '-a[Specify account name (required)]' \
  71. '-c[Specify item creator (optional four-character code)]' \
  72. '-C[Specify item type (optional four-character code)]' \
  73. '-d[Specify security domain string (optional)]' \
  74. '-D[Specify kind (default is "Internet password")]' \
  75. '-j[Specify comment string (optional)]' \
  76. '-l[Specify label (if omitted, server name is used as default label)]' \
  77. '-p[Specify path string (optional)]' \
  78. '-P[Specify port number (optional)]' \
  79. '-r[Specify protocol (optional four-character SecProtocolType, e.g. "http", "ftp ")]' \
  80. '-s[Specify server name (required)]' \
  81. '-t[Specify authentication type (as a four-character SecAuthenticationType, default is "dflt")]' \
  82. '-w[Specify password to be added]' \
  83. '-A[Allow any application to access this item without warning (insecure, not recommended!)]' \
  84. '-T[Specify an application which may access this item (multiple -T options are allowed)]' \
  85. '-U[Update item if it already exists (if omitted, the item cannot already exist) ]' \
  86. 'utils)]' ;;
  87. esac