SFKeychainSavePanel 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 | SFKeychainSavePanel.h |
Overview
The SFKeychainSavePanel class displays a sheet or panel that allows the user to create a keychain.
The following figure shows an example of a keychain save panel.

Tasks
Returning a Shared Keychain Save Panel Object
Displaying a Sheet or Panel
-
– setPassword: -
– beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo: -
– runModalForDirectory:file:
Returning Information from the Sheet or Panel
Class Methods
sharedKeychainSavePanel
Returns a shared keychain save panel object. If the object has not already been created, this method allocates and initializes the object first.
Availability
- Available in OS X v10.3 and later.
Declared In
SFKeychainSavePanel.hInstance Methods
beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo:
Displays a sheet that allows a user to create a new keychain.
Parameters
- path
The path to the folder where the keychain is created. Specify
nilfor~/Library/Keychains.- name
The keychain name to be automatically displayed in the Save As field of the sheet.
- 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
didEndSelectorparameter 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.
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
NSFileHandlingPanelOKButtonorNSFileHandlingPanelCancelButton.- contextInfo
Client-defined contextual data that is passed in the
contextInfoparameter of thebeginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo: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.
Use the keychain method to obtain the keychain created by the user.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
SFKeychainSavePanel.herror
Returns the last error encountered by the keychain save panel.
Availability
- Available in OS X v10.5 and later.
Declared In
SFKeychainSavePanel.hkeychain
Returns the keychain created by the keychain save panel.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
SFKeychainSavePanel.hrunModalForDirectory:file:
Displays a panel that allows a user to create a new keychain.
Parameters
- path
The path to the folder where the keychain is created. Specify
nilfor~/Library/Keychains.- name
The keychain name to be automatically displayed in the Save As field of the panel.
Discussion
This method returns a result code from the runModalForDirectory:file: method of the NSSavePanel class: NSFileHandlingPanelOKButton if the user clicks the OK button or NSFileHandlingPanelCancelButton if the user clicks the Cancel button.
Use the keychain method to obtain the keychain created by the user.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
SFKeychainSavePanel.hsetPassword:
Specifies the password for the keychain that will be created.
Parameters
- password
The password to be used for the new keychain.
Discussion
This method is optional. If you don’t call this method, the keychain save panel displays a password-entry dialog.
Availability
- Available in OS X v10.3 and later.
Declared In
SFKeychainSavePanel.h© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-06-11)