Get calling applications from CryptoTokenKit extension

Is it possible to get the process (name, executable location) that triggers CryptoTokenKit extension security operation, such as signData or decryptData?

We are developing smart card middleware, for both Windows (minidriver) and macOS (CryptoTokenKit extension). We would like the possibility to configure various parts of our implementation based on the calling process. For example, we would like to cache PIN code in memory for particular amount of time, that is different for web browser and email client.

On Windows it can be done, since minidriver dll is loaded into the calling application process. By calling GetCurrentProcess() inside our minidriver, we can figure out what application is using it. On macOS, however, there is a single process that handles all requests from the apps, using smart cards. So getting current process info does not help. Is there a way to get calling application somehow?

Is it possible to get the process … that triggers CryptoTokenKit extension security operation … ?

No. App extension do not, in general, get information about their host app. It’s possible for a specific appex subsystem to change that, by way of a subsystem specific API, but CryptoTokenKit has no such API.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Get calling applications from CryptoTokenKit extension
 
 
Q