Removes a guest from a host.


func SecHostRemoveGuest(_ host: SecGuestRef, _ guest: SecGuestRef, _ flags: SecCSFlags) -> OSStatus



The guest code object of the host of the guest. You cannot specify a host of a host here except in the case of a dedicated host. For a dedicated host, the dedicated host is automatically substituted for its guest. See kSecCSDedicatedHost for a discussion of dedicated hosts.


The guest code object for the guest whose guest relationship you wish to terminate.


Optional flags; see SecCSFlags for possible values. Pass defaultFlags for standard behavior.

Return Value


This function removes all memory of the guest-host relationship from the Code Signing Services hosting system. You cannot remove a dedicated guest. The specified guest must have been created using the SecHostCreateGuest(_:_:_:_:_:_:) function. If you remove a guest that is also a host, all of the guest’s guests are removed, recursively, as well, even if one or more of those guests are dedicated hosts.

See Also

Guest Management

func SecCodeCopyHost(SecCode, SecCSFlags, UnsafeMutablePointer<SecCode?>) -> OSStatus

Retrieves the code object for the host of specified guest code.

func SecHostSelectGuest(SecGuestRef, SecCSFlags) -> OSStatus

Makes the calling thread the proxy for a specified guest.

func SecHostSelectedGuest(SecCSFlags, UnsafeMutablePointer<SecGuestRef>) -> OSStatus

Retrieves the handle for the guest currently selected for the calling thread.

func SecHostSetHostingPort(mach_port_t, SecCSFlags) -> OSStatus

Tells code signing services that the calling code will directly respond to hosting inquiries over the given port.

func SecCodeMapMemory(SecStaticCode, SecCSFlags) -> OSStatus

Asks the kernel to accept the signing information currently attached to a code object and uses it to validate memory page-ins.