pub type SecKeychainCallback = Option<unsafe extern "C-unwind" fn(SecKeychainEvent, NonNull<SecKeychainCallbackInfo>, *mut c_void) -> i32>;
SecBase
and SecKeychain
and libc
only.Expand description
Defines a pointer to a customized callback function. You supply the customized callback function to do a callback tailored to your application’s needs.
Parameter keychainEvent
: The keychain event that your application wishes to be notified of. See SecKeychainEvent for a description of possible values. The type of event that can trigger your callback depends on the bit mask you passed in the eventMask parameter of the function SecKeychainAddCallback. For more information, see the discussion.
Parameter info
: A pointer to a structure of type SecKeychainCallbackInfo. On return, the structure contains information about the keychain event that occurred. The Keychain Manager passes this information to your callback function via the info parameter.
Parameter context
: A pointer to application-defined storage that your application previously passed to the function SecKeychainAddCallback. You can use this value to perform operations like track which instance of a function is operating.
Returns: A result code. See “Security Error Codes” (SecBase.h).
If you name your function MyKeychainEventCallback, you would declare it like this: OSStatus MyKeychainEventCallback ( SecKeychainEvent keychainEvent, SecKeychainCallbackInfo *info, void *context);
To add your callback function, use the SecKeychainAddCallback function. To remove your callback function, use the SecKeychainRemoveCallback function.
See also Apple’s documentation
Aliased Type§
pub enum SecKeychainCallback {
None,
Some(unsafe extern "C-unwind" fn(SecKeychainEvent, NonNull<SecKeychainCallbackInfo>, *mut c_void) -> i32),
}
Variants§
None
No value.
Some(unsafe extern "C-unwind" fn(SecKeychainEvent, NonNull<SecKeychainCallbackInfo>, *mut c_void) -> i32)
Some value of type T
.