SFKeychainSettingsPanel Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/SecurityInterface.framework
Availability
Available in OS X v10.3 and later
Companion guide
Declared in
SFKeychainSettingsPanel.h

Overview

The SFKeychainSettingsPanelclass displays a panel or sheet that allows users to change their keychain settings.

Keychain settings include:

The following figure shows an example of a keychain settings panel.

Figure 1  Keychain settings panel
Keychain settings panel

Tasks

Returning a Shared Keychain Save Panel Object

Displaying a Sheet or Panel

Class Methods

sharedKeychainSettingsPanel

Returns a shared keychain settings panel object. If the object has not already been created, this method allocates and initializes the object first.

+ (SFKeychainSettingsPanel *)sharedKeychainSettingsPanel
Availability
  • Available in OS X v10.3 and later.
Declared In
SFKeychainSettingsPanel.h

Instance Methods

beginSheetForWindow:modalDelegate:didEndSelector:contextInfo:settings:keychain:

Displays a sheet that allows users to change keychain settings.

- (void)beginSheetForWindow:(NSWindow *)docWindow modalDelegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo settings:(SecKeychainSettings *)settings keychain:(SecKeychainRef)keychain
Parameters
docWindow

The parent window to which the sheet is attached. If this parameter is nil, the behavior defaults to a standalone modal window.

delegate

The delegate object in which the method specified in the didEndSelector parameter is implemented.

didEndSelector

A method selector for a delegate method called after the modal session has ended, but before the sheet has been dismissed. Implementation of this delegate method is optional.

contextInfo

A pointer to data that is passed to the delegate method. You can use this data pointer for any purpose you wish.

settings

A pointer to a keychain settings structure. Because this structure is versioned, you must preallocate it and fill in the version of the structure.

keychain

The keychain whose settings you wish to have the user change.

Discussion

The delegate method has the following signature:

-(void)createPanelDidEnd:(NSWindow *)sheet
       returnCode:(int)returnCode
       contextInfo:(void *)contextInfo

The parameters for the delegate method are:

sheet

The window to which the sheet was attached.

returnCode

The result code indicating which button the user clicked: either NSFileHandlingPanelOKButton or NSFileHandlingPanelCancelButton.

contextInfo

Client-defined contextual data that is passed in the contextInfo parameter of the beginSheetForDirectory:... method.

The delegate method may dismiss the keychain settings sheet itself; if it does not, the sheet is dismissed on return from the beginSheetForDirectory:... method.

Availability
  • Available in OS X v10.3 and later.
Declared In
SFKeychainSettingsPanel.h

runModalForSettings:keychain:

Displays a panel that allows users to change keychain settings.

- (NSInt)runModalForSettings:(SecKeychainSettings *)settings keychain:(SecKeychainRef)keychain
Parameters
settings

A pointer to a keychain settngs structure. Because this structure is versioned, you must preallocate it and fill in the version of the structure.

keychain

The keychain whose settings you wish to have the user change.

Discussion

The method result indicates which button the user clicks: NSOKButton or NSCancelButton .

If the user attempts to chanage the settings of a locked keychain, the unlock authorization dialog appears.

Availability
  • Available in OS X v10.3 and later.
Declared In
SFKeychainSettingsPanel.h