MBS Plugin Documentation

Search:

Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchie

New in Version 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 9.0

The list of the   themes,   classes,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

KeyChainManagerMBS.AddAppleSharePassword(parameter as KeyChainRequestMBS) as KeyChainItemMBS
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 6.3, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Adds a new Apple Share Password to the keychain.
Notes:
The AddAppleSharePassword function adds a new generic password to the default KeyChain. Required parameters to identify the password are servername/serverAddress and accountName, which are application-defined strings. AddAppleSharePassword returns a reference to the newly added item.

You can use AddAppleSharePassword to add passwords for accounts other than Internet or Appleshare. For example, you might add passwords for your database or scheduling programs.

From the KeyChainRequestMBS object, the properties AFPServerSignature, serverAddress, servername, volumeName, accountName, and password.

LastError is set.
KeyChainManagerMBS.AddGenericPassword(parameter as KeyChainRequestMBS) as KeyChainItemMBS
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Adds a new generic password to the default KeyChain.
Example:
// Example for reading and writing a generic password:

dim m as KeyChainManagerMBS
dim r as KeyChainRequestMBS
dim s as KeyChainRequestMBS
dim i as KeyChainItemMBS

m=new KeyChainManagerMBS
r=new KeyChainRequestMBS
r.AccountName="Boss"
r.ServiceName="RBTest"
r.Password="secret"
i=m.AddGenericPassword(r)
if i<>nil then
MsgBox "Password added to current keychain."
else
MsgBox "Could not add password to keychain. Maybe no Keychain software installed or not enough permissions to create an entry in the keychain (e.g. booted from CD)"
Return // exit
end if

// later...

m=new KeyChainManagerMBS
s=new KeyChainRequestMBS
s.AccountName="Boss"
s.ServiceName="RBTest"
i=m.FindGenericPassword(s)
if i<>nil then
MsgBox "Found password: "+s.Password
i.Delete // delete it.
else
MsgBox "Password not found!"
end if

Notes:
The AddGenericPassword function adds a new generic password to the default KeyChain. Required parameters to identify the password are serviceName and accountName, which are application-defined strings. AddGenericPassword returns a reference to the newly added item.

You can use AddGenericPassword to add passwords for accounts other than Internet or Appleshare. For example, you might add passwords for your database or scheduling programs.

From the KeyChainRequestMBS object, the properties servicename, accountname and password.

LastError is set.
KeyChainManagerMBS.AddInternetPassword(parameter as KeyChainRequestMBS) as KeyChainItemMBS
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Adds a new Internet server password to the default KeyChain.
Notes:
The AddInternetPassword function adds a new Internet server password to the default KeyChain. Required parameters to identify the password are serviceName and accountName (you cannot pass "" for both parameters). In addition, some protocols may require an optional securityDomain when authentication is requested. AddInternetPassword returns a reference to the newly added item.

AddInternetPassword will automatically call the Unlock function to display the Unlock KeyChain dialog box if the KeyChain containing the password is currently locked.

From the KeyChainRequestMBS object, the properties servername, securitydomain, accountname, port, protocol, authtype and password.

LastError is set.
KeyChainManagerMBS.AddInternetPasswordWithPath(parameter as KeyChainRequestMBS) as KeyChainItemMBS
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Adds a new Internet server password with a specified path to the default KeyChain.
Notes:
The AddInternetPasswordWithPath function enables you to specify path information when adding a new Internet server password to the default KeyChain. Required parameters to identify the password are serviceName and accountName (you cannot pass "" for both parameters). In addition, some protocols may require an optional securityDomain when authentication is requested. AddInternetPasswordWithPath returns a reference to the newly added item.

AddInternetPasswordWithPath will automatically call the unlock function to display the Unlock KeyChain dialog box if the KeyChain containing the password is currently locked.

From the KeyChainRequestMBS object, the properties servername, securitydomain, accountname, path, port, protocol, authtype and password.

LastError is set.
KeyChainManagerMBS.available as boolean
property, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: whether the KeyChain manager is available.
Notes: (Read only property)
class KeyChainManagerMBS
class, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: A class for the functions of the KeyChain manager.
Notes:
Class constants:
kCertificateKCItemClass"cert"Certificate
kAppleSharePasswordKCItemClass"ashp"Appleshare password
kInternetPasswordKCItemClass"inet"Internet password
kGenericPasswordKCItemClass"genp"Generic password
KeyChainManagerMBS.CountKeychains as integer
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Determines the number of available keychains.
Notes:
This function reports the number of keychains known to the KeyChain Manager. These keychains are created by the function CreateKeychain and placed in the Keychains Folder in the Preferences Folder, inside the active System Folder.

function result:
The number of available keychains. This includes all keychains in the Keychains folder, as well as any other keychains known to the KeyChain Manager.

LastError is set.
KeyChainManagerMBS.CreateKeyChain(password as string) as KeyChainMBS
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Creates an empty KeyChain.
Notes:
Password is a string representing the password string which will be used to protect the new KeyChain. If you pass "", the KeyChain Setup dialog box will be displayed to obtain it.

The CreateKeychain function creates an empty KeyChain. The KeyChain and password parameters are optional. If user interaction to create a KeyChain is posted, the newly-created KeyChain is automatically unlocked after creation.

LastError is set.
KeyChainManagerMBS.DefaultKeyChainChangeSettings
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Displays a dialog box enabling the user to change the name, password, or settings of the default KeyChain.
Notes:
Typically, your application should not call the ChangeSettings function. You would only call ChangeSettings in response to a user's request to change KeyChain settings, name, or password. Note that you cannot change a KeyChain passphrase directly. You must call ChangeSettings and allow the user to change it.

LastError is set.
KeyChainManagerMBS.DefaultKeyChainStatus as integer
property, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Returns the current state of the default KeyChain.
Notes:
LastError is set.

Constants:

kSecUnlockStateStatus1Indicates the KeyChain is unlocked.
kSecRdPermStatus2Indicates the KeyChain is read-only.
kSecWrPermStatus4Indicates the KeyChain is writable.
(Read only property)
KeyChainManagerMBS.FindAppleSharePassword(parameter as KeyChainRequestMBS) as KeyChainItemMBS
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 6.3, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Finds the first Apple Share password in the default KeyChain that matches the specified parameters.
Notes:
The FindAppleSharePassword function finds the Apple Share password item which matches the attributes you provide. FindGenericPassword returns a reference to the found item.

FindAppleSharePassword will automatically call the unlock function to display the Unlock KeyChain dialog box if the KeyChain containing the password is currently locked.

From the KeyChainRequestMBS object, the properties AFPServerSignature, serverAddress, servername, volumeName, accountName, and password. (password is set if the function is successfull.)

All values maybe "" to match any value.

LastError is set.
KeyChainManagerMBS.FindGenericPassword(parameter as KeyChainRequestMBS) as KeyChainItemMBS
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Finds the first Internet password in the default KeyChain that matches the specified parameters.
Example:
// Example for reading and writing a generic password:

dim m as KeyChainManagerMBS
dim r as KeyChainRequestMBS
dim s as KeyChainRequestMBS
dim i as KeyChainItemMBS

m=new KeyChainManagerMBS
r=new KeyChainRequestMBS
r.AccountName="Boss"
r.ServiceName="RBTest"
r.Password="secret"
i=m.AddGenericPassword(r)
if i<>nil then
MsgBox "Password added to current keychain."
else
MsgBox "Could not add password to keychain. Maybe no Keychain software installed or not enough permissions to create an entry in the keychain (e.g. booted from CD)"
Return // exit
end if

// later...

m=new KeyChainManagerMBS
s=new KeyChainRequestMBS
s.AccountName="Boss"
s.ServiceName="RBTest"
i=m.FindGenericPassword(s)
if i<>nil then
MsgBox "Found password: "+s.Password
i.Delete // delete it.
else
MsgBox "Password not found!"
end if

Notes:
The FindGenericPassword function finds the first password item which matches the attributes you provide. FindGenericPassword returns a reference to the found item.

FindGenericPassword will automatically call the unlock function to display the Unlock KeyChain dialog box if the KeyChain containing the password is currently locked.

From the KeyChainRequestMBS object, the properties servicename, accountname, and password. (password is set if the function is successfull.)

servicename and accountname maybe "" to match any value.

LastError is set.
KeyChainManagerMBS.FindInternetPassword(parameter as KeyChainRequestMBS) as KeyChainItemMBS
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Finds the first Internet password in the default KeyChain that matches the specified parameters.
Notes:
The FindInternetPassword function finds the first Internet password item which matches the attributes you provide. FindInternetPassword returns a reference to the found item.

FindInternetPassword will automatically call the unlock function to display the Unlock KeyChain dialog box if the KeyChain containing the password is currently locked.

From the KeyChainRequestMBS object, the properties servername, securitydomain, accountname, port, protocol, authtype and password. (password is set if the function is successfull.)

Servername, securitydomain, protocol, authtype and accountname maybe "" to match any value. Port may be 0 to match any port value.

LastError is set.
KeyChainManagerMBS.FindInternetPasswordWithPath(parameter as KeyChainRequestMBS) as KeyChainItemMBS
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Finds the first Internet password in the default KeyChain that matches the specified parameters.
Notes:
The FindInternetPasswordWithPath function finds the first Internet password item which matches the attributes you provide. FindInternetPasswordWithPath returns a reference to the found item.

FindInternetPasswordWithPath will automatically call the unlock function to display the Unlock KeyChain dialog box if the KeyChain containing the password is currently locked.

From the KeyChainRequestMBS object, the properties servername, securitydomain, accountname, path, port, protocol, authtype and password. (password is set if the function is successfull.)

Servername, securitydomain, path, protocol, authtype and accountname maybe "" to match any value. Port may be 0 to match any port value.

LastError is set.
KeyChainManagerMBS.InteractionAllowed as boolean
property, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: whether the KeyChain manager is allowed to show dialogs to ask the user.
Notes:
LastError is set.
(Read and Write property)
KeyChainManagerMBS.KeyChainFindFirst(kc as KeyChainMBS) as KeyChainSearchItemMBS
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Finds the first KeyChain item in a specified KeyChain.
Example:
dim m as new KeyChainManagerMBS
dim s as KeyChainSearchItemMBS
dim it as KeyChainItemMBS
dim text as string

const kServiceKCItemAttr="svce"
const kAccountKCItemAttr="acct"

listbox1.DeleteAllRows

s=m.KeyChainFindFirst(nil)

do
it=s.Item

text=it.GetString(kServiceKCItemAttr,1000)
if text="RBTest" then
Listbox1.AddRow it.GetString(kAccountKCItemAttr,1000)
end if
loop until not s.FindNext

Notes:
The parameter kc is the KeyChain that you wish to search. If you pass a locked KeyChainMBS, the Unlock KeyChain dialog box is displayed. If you pass nil, KeyChainFindFirst search all unlocked keychains.

Returns an object of the KeyChainSearchItemMBS class with the first found item in the item property. Returns nil on any error.

LastError is set.
KeyChainManagerMBS.LastError as integer
property, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: The number representing the last error reported.
Notes:
If a function is not available (e.g. KeyChain Manager not installed), the lasterror property has the value -1. If the plugin was unable to allocate memory, -2 is returned.

KeyChain Manager error codes:

errKCNotAvailable-25291Indicates that the KeyChain Manager was not loaded.
errKCReadOnly-25292Returned by the function KCCopyItem to indicate that the KeyChain file is read-only and cannot be edited.
errKCAuthFailed-25293Returned by the function KCUnlock to indicate that the authentication failed (too many unsuccessful retries).
errKCNoSuchKeychain-25294Returned by the functions KCUnlock, KCSetDefaultKeychain, KCGetStatus, and KCGetIndKeychain to indicate that the specified KeyChain was not found.
errKCInvalidKeychain-25295Returned by the functions KCUnlock, KCSetDefaultKeychain, KCGetStatus, KCGetKeychainName, KCChangeSettings, and KCCreateKeychain to indicate that the KeyChain is not valid.
errKCDuplicateKeychain-25296Returned by the function KCCreateKeychain to indicate that your application tried to create a KeyChain that already exists.
errKCDuplicateCallback-25297Returned by the function KCAddCallback to indicate that your callback function was already registered.
errKCInvalidCallback-25298Returned by the function KCRemoveCallback to indicate that the callback function was not previously registered.
errKCDuplicateItem-25299Returned by the functions KCAddAppleSharePassword, KCAddInternetPassword, KCAddInternetPasswordWithPath, KCAddGenericPassword, and KCAddItem to indicate that you tried to add an existing KeyChain item to the KeyChain.
errKCItemNotFound-25300Returned by the functions KCFindAppleSharePassword, KCFindInternetPassword, KCFindInternetPasswordWithPath, KCFindGenericPassword, KCFindNextItem, and KCFindFirstItem to indicate that no matching item was found.
errKCBufferTooSmall-25301Returned by the functions KCFindAppleSharePassword, KCFindInternetPassword, KCFindInternetPasswordWithPath, KCFindGenericPassword, KCGetAttribute, KCGetData, and KCFindX509Certificates to indicate that the buffer was not large enough to contain the password data.
errKCDataTooLarge-25302Returned by the functions KCAddAppleSharePassword, KCAddInternetPassword, KCAddInternetPasswordWithPath, KCAddGenericPassword, KCSetAttribute, and KCSetData to indicate that the data is too large.
errKCNoSuchAttr-25303Returned by the functions KCSetAttribute, KCGetAttribute, and KCFindFirstItem to indicate that no such attribute exists.
errKCInvalidItemRef-25304Returned by the functions KCSetAttribute, KCGetAttribute, KCSetData, KCGetData, KCAddItem, KCDeleteItem, KCUpdateItem, KCCopyItem, and KCGetKeychain to indicate that the KeyChain item reference is invalid.
errKCInvalidSearchRef-25305Returned by the functions KCFindNextItem and KCReleaseSearch to indicate that the specified search reference is invalid.
errKCNoSuchClass-25306Returned by the function KCCopyItem to indicate that the item class does not exist.
errKCNoDefaultKeychain-25307Returned by the functions KCChangeSettings, KCSetDefaultKeychain, KCGetDefaultKeychain, KCAddAppleSharePassword, KCAddInternetPassword, KCAddInternetPasswordWithPath, KCAddGenericPassword, KCFindAppleSharePassword, KCFindInternetPassword, KCFindInternetPasswordWithPath, KCFindGenericPassword, KCCopyItem, KCAddItem, KCDeleteItem, KCUpdateItem, KCFindNextItem, KCFindFirstItem, and KCFindX509Certificates to indicate that there is no default KeyChain.
errKCInteractionNotAllowed-25308Returned by the functions KCCreateKeychain, KCChangeSettings, KCUnlock, and KCGetData (the latter two only when the Unlock Dialog and Allow Access dialog boxes are needed) to indicate that there is no start-up KeyChain.
errKCReadOnlyAttr-25309Returned by the function KCSetAttribute to indicate that the KeyChain item attribute is read-only.
errKCWrongKCVersion-25310Indicates that the wrong version of KeyChain Manager is installed to perform this operation.
errKCKeySizeNotAllowed-25311Indicates that the key size is illegal.
errKCNoStorageModule-25312Returned by functions that prompts the loading of the KeyChain Manager to indicate that the storage module is not found.
errKCNoCertificateModule-25313Returned when a function is required for a certificate and the certificate module is not found.
errKCNoPolicyModule-25314Returned when a function is required for a trust policy and the policy module is not found.
errKCInteractionRequired-25315Returned by the function KCUnlock to indicate that user interaction is required for this operation.
errKCDataNotAvailable-25316Indicates that the requested data is not available.
errKCDataNotModifiable-25317Returned by the functions KCSetData and KCGetData to indicate that the data cannot be modified.
errKCCreateChainFailed-25318Returned by the functions KCChooseCertificate and KCFindX509Certificates to indicate that the attempt to create a new KeyChain failed.
(Read only property)
KeyChainManagerMBS.LockDefaultKeyChain
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Locks the default KeyChain.
Notes:
Your application should not call LockDefaultKeyChain unless you are responding to a user's request to lock a KeyChain. In general, you should leave the KeyChain unlocked so that the user does not have to unlock it again in another application.

LastError is set.
KeyChainManagerMBS.NewKeyChainItemMemory(KeyClass as string,creator as string,data as memoryblock) as KeyChainItemMBS
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Creates a new KeyChainItemMBS Object with the given data.
Notes:
Values for the class parameter which defines the type of the item:

kCertificateKCItemClass"cert"Specifies that the item is a digital certificate.
kAppleSharePasswordKCItemClass"ashp"Specifies that the item is an AppleShare password.
kInternetPasswordKCItemClass"inet"Specifies that the item is an Internet password.
kGenericPasswordKCItemClass"genp"Specifies that the item is a generic password.

The creator parameter is the creator code of the application that owns this item.
Data is the data which is saved inside the item.

LastError is set.
KeyChainManagerMBS.NewKeyChainItemString(KeyClass as string,creator as string,data as string) as KeyChainItemMBS
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Creates a new KeyChainItemMBS Object with the given data.
Notes:
Values for the class parameter which defines the type of the item:

kCertificateKCItemClass"cert"Specifies that the item is a digital certificate.
kAppleSharePasswordKCItemClass"ashp"Specifies that the item is an AppleShare password.
kInternetPasswordKCItemClass"inet"Specifies that the item is an Internet password.
kGenericPasswordKCItemClass"genp"Specifies that the item is a generic password.

The creator parameter is the creator code of the application that owns this item.
Data is the data which is saved inside the item.

LastError is set.
KeyChainManagerMBS.OpenDefaultKeyChain as KeyChainMBS
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Obtains the default KeyChain.
Notes: LastError is set.
KeyChainManagerMBS.OpenIndexedKeyChain(index as integer) as KeyChainMBS
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Obtains the reference to an indexed KeyChain.
Notes:
Pass a value between 1 and the number returned by the function CountKeychains for the index parameter.

To guarantee correct operation, you should call the function CountKeychains once before calling OpenIndexedKeyChain.

LastError is set.
KeyChainManagerMBS.UnlockDefaultKeyChain(password as string) as boolean
method, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Displays a dialog box that prompts the user for a password in order before unlocking KeyChain.
Notes:
In most cases, your application does not need to call the Unlock functions directly, since most KeyChain Manager functions that require an unlocked KeyChain call Unlock automatically. If your application needs to verify that a KeyChain is unlocked, use the property DefaultKeyChainStatus.

LastError is set.
KeyChainManagerMBS.Version as integer
property, KeyChain, MBS Mac Plugin (KeyChain), class KeyChainManagerMBS, Console safe, Plugin version: 2.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: The version number of the KeyChain manager.
Notes:
Lasterror is set.
(Read only property)

The items on this page are in the following plugins: MBS Mac Plugin.