I'm looking into a newer XPC API available starting with macOS 14. Although it's declared as a low-level API I can't figure it how to specify code signing requirement using XPCListener and XPCSession. How do I connect it with xpc_listener_set_peer_code_signing_requirement and xpc_connection_set_peer_code_signing_requirement which require xpc_listener_t and xpc_connection_t respectively?
Foundation XPC is declared as a high-level API and provides easy ways to specify code signing requirements on both ends of xpc.
I'm confused with all these XPC APIs and their future:
-
Newer really high-level XPCListener and XPCSession API (in low-level framework???)
-
Low-level xpc_listener_t & xpc_connection_t -like API. Is it being replaced by newer XPCListener and XPCSession?
-
How is it related to High-level Foundation XPC? Are NSXPCListener and NSXPCConnection going to be deprecated and replaced by XPCListener and XPCSession??
this feature is missing from the new API
pavel-kozlov-01 didn’t post a bug number here, so it’s hard for me to track their enhancement. However, my understanding from reading an internal bug report (r. 132430549) is that we added support for this in macOS 26 (currently in beta). Specifically:
- There’s a new
XPCPeerRequirement
type. - You can pass that in to the
XPCListener
class via various new initialisers. - Likewise for the
XPCSession
class. - Sessions also support
setPeerRequirement(_:)
method. - There’s also a
XPCReceivedMessage.senderSatisfies(_:)
method
I’ve not actually tried any of this myself, but it certainly looks promising.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"