Structure
SecurityCLI
A typed wrapper for macOS security CLI commands.
struct SecurityCLIOverview
Use this command family for all keychain and certificate operations instead of constructing raw Command("security", ...) values at call sites.
Topics
Initializers
init(context: ShellContext)Creates a
securitycommand family bound to a shell context.
Instance Properties
let arguments: [String]Typed
securityarguments for the selected operation.let config: ToolConfigurationShared configuration applied to commands produced by this client.
var context: ShellContextThe shell context used when running this command family.
let stderrDestination: OutputDestinationThe stderr handling strategy for built commands.
let stdoutDestination: OutputDestinationThe stdout handling strategy for built commands.
Instance Methods
func command() -> CommandBuilds the raw
securitycommand.func createKeychain(name: String, password: String) -> SecurityCLIUses the
security create-keychainsubcommand.func deleteKeychain(name: String) -> SecurityCLIUses the
security delete-keychainsubcommand.func help(String?) -> SecurityCLIUses the
security helpsubcommand.func importCertificate(at: String, keychainName: String, password: String, trustedApplications: [String]) -> SecurityCLIUses the
security importsubcommand for a certificate file.func setKeyPartitionList(services: String, password: String, keychainName: String) -> SecurityCLIUses the
security set-key-partition-listsubcommand.func setKeychainSettings(name: String, timeout: Int) -> SecurityCLIUses the
security set-keychain-settingssubcommand.func setUserKeychainSearchList([String]) -> SecurityCLIUses the
security list-keychains -d user -s ...subcommand.func settingStderrDestination(OutputDestination) -> SecurityCLIRedirects stderr for the built
securitycommand.func settingStdoutDestination(OutputDestination) -> SecurityCLIRedirects stdout for the built
securitycommand.func unlockKeychain(name: String, password: String) -> SecurityCLIUses the
security unlock-keychainsubcommand.func updatingConfiguration((ToolConfiguration) -> ToolConfiguration) -> SecurityCLIReturns a new value with updated shared tool configuration.
Relationships
Conforms To
Swift.SendableSwift.SendableMetatypeSwiftyShell.OutputRedirectingCommandFamilySwiftyShell.RunnableCommandFamilySwiftyShell.ToolConfigurableCommandFamily