| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/SecurityInterface.framework |
| Availability | Available in Mac OS X v10.3 and later
|
| Companion guide | |
| Declared in | SFKeychainSavePanel.h |
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.
– setPassword:
– beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo:
– runModalForDirectory:file:
Returns a shared keychain save panel object. If the object has not already been created, this method allocates and initializes the object first.
+ (SFKeychainSavePanel *)sharedKeychainSavePanel
SFKeychainSavePanel.hDisplays a sheet that allows a user to create a new keychain.
- (void)beginSheetForDirectory:(NSString *)path file:(NSString *)name modalForWindow:(NSWindow *)docWindow modalDelegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo
The path to the folder where the keychain is created. Specify nil for ~/Library/Keychains.
The keychain name to be automatically displayed in the Save As field of the sheet.
The parent window to which the sheet is attached. If this parameter is nil, the behavior defaults to a standalone modal window.
The delegate object in which the method specified in the didEndSelector parameter is implemented.
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.
A pointer to data that is passed to the delegate method. You can use this data pointer for any purpose you wish.
The delegate method has the following signature:
-(void)createPanelDidEnd:(NSWindow *)sheet |
returnCode:(int)returnCode |
contextInfo:(void *)contextInfo |
The parameters for the delegate method are:
The window to which the sheet was attached.
The result code indicating which button the user clicked: either NSFileHandlingPanelOKButton or NSFileHandlingPanelCancelButton.
Client-defined contextual data that is passed in the contextInfo parameter of the beginSheetForDirectory: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.
SFKeychainSavePanel.hReturns the keychain created by the keychain save panel.
- (SecKeychainRef)keychain
– beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo:– runModalForDirectory:file:SFKeychainSavePanel.hDisplays a panel that allows a user to create a new keychain.
- (NSInt)runModalForDirectory:(NSString *)path file:(NSString *)name
The path to the folder where the keychain is created. Specify nil for ~/Library/Keychains.
The keychain name to be automatically displayed in the Save As field of the panel.
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.
-runModalForDirectory:file: (NSSavePanel)– keychain– beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo:SFKeychainSavePanel.hSpecifies the password for the keychain that will be created.
- (void)setPassword:(NSString *)password
The password to be used for the new keychain.
This method is optional. If you don’t call this method, the keychain save panel displays a password-entry dialog.
SFKeychainSavePanel.h
Last updated: 2006-05-23