Platforms to show: All Mac Windows Linux Cross-Platform
The module KeychainManagerMBS
module KeychainManagerMBSType | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
module | Keychain | MBS MacClassic Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
For iOS please define a keychain access group in Xojo build settings. Then prefix it with your developer ID as you can see it in the generated entitlement file inside your app. Pass the prefixed string to our functions with kSecAttrAccessGroup key.
- method AddGenericPassword(keychain as KeychainMBS, serviceName as string, accountName as string, password as memoryblock) as KeychainItemMBS
- method AddGenericPassword(keychain as KeychainMBS, serviceName as string, accountName as string, password as string) as KeychainItemMBS
- method AddInternetPassword(keychain as KeychainMBS, serverName as string, securityDomain as string, accountName as string, path as string, port as Integer, protocol as string, authenticationType as string, password as memoryblock) as KeychainItemMBS
- method AddInternetPassword(keychain as KeychainMBS, serverName as string, securityDomain as string, accountName as string, path as string, port as Integer, protocol as string, authenticationType as string, password as string) as KeychainItemMBS
- method AddItem(attributesDictionary as dictionary) as boolean
- method AddItem(attributesDictionary as dictionary, byref result as variant) as boolean
- method AddItem(Keychain as KeychainMBS, attributesDictionary as dictionary) as boolean
- method AddItem(Keychain as KeychainMBS, attributesDictionary as dictionary, byref result as Variant) as boolean
- method AddItemAsync(attributesDictionary as dictionary, handler as AddItemAsyncCompletedMBS, tag as Variant = nil)
- method AddItemAsync(Keychain as KeychainMBS, attributesDictionary as dictionary, handler as AddItemAsyncCompletedMBS, tag as Variant = nil)
- method AllItems(keychain as KeychainMBS, itemClass as string) as KeychainItemMBS()
- method CopyMatching(Query as dictionary, byref result as Variant) as boolean
- method CopyMatchingAsync(Query as dictionary, handler as CopyMatchingAsyncCompletedMBS, tag as Variant = nil)
- method CopyMatchingDictionaries(Query as dictionary) as Dictionary()
- method CopyMatchingItems(Query as dictionary) as KeychainItemMBS()
- method Default as KeychainMBS
- method DeleteItem(Query as Dictionary) as boolean
- method DomainDefault(domain as Integer) as KeychainMBS
- method DomainSearchList(domain as Integer) as KeychainMBS()
- method ErrorMessageString(error as Integer) as string
- method FindGenericItem(keychain as KeychainMBS, serviceName as string, accountName as string) as KeychainItemMBS
- method FindGenericPassword(keychain as KeychainMBS, serviceName as string, accountName as string, byref password as memoryblock) as KeychainItemMBS
- method FindInternetItem(keychain as KeychainMBS, serverName as string, securityDomain as string, accountName as string, path as string, port as Integer, protocol as string, authenticationType as string) as KeychainItemMBS
- method FindInternetPassword(keychain as KeychainMBS, serverName as string, securityDomain as string, accountName as string, path as string, port as Integer, protocol as string, authenticationType as string, byref password as memoryblock) as KeychainItemMBS
- method GetPassword(Query as dictionary, byref result as Memoryblock) as boolean
- method ItemFromPersistentReference(data as memoryblock) as KeychainItemMBS
- method kSecAttrAccess as string
- method kSecAttrAccessControl as string
- method kSecAttrAccessGroup as string
- method kSecAttrAccessible as string
- method kSecAttrAccessibleAfterFirstUnlock as string
- method kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly as string
- method kSecAttrAccessibleAlways as string
- method kSecAttrAccessibleAlwaysThisDeviceOnly as string
- method kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly as string
- method kSecAttrAccessibleWhenUnlocked as string
- method kSecAttrAccessibleWhenUnlockedThisDeviceOnly as string
- method kSecAttrAccount as string
- method kSecAttrApplicationLabel as string
- method kSecAttrApplicationTag as string
- method kSecAttrAuthenticationType as string
- method kSecAttrAuthenticationTypeDefault as string
- method kSecAttrAuthenticationTypeDPA as string
- method kSecAttrAuthenticationTypeHTMLForm as string
- method kSecAttrAuthenticationTypeHTTPBasic as string
- method kSecAttrAuthenticationTypeHTTPDigest as string
- method kSecAttrAuthenticationTypeMSN as string
- method kSecAttrAuthenticationTypeNTLM as string
- method kSecAttrAuthenticationTypeRPA as string
- method kSecAttrCanDecrypt as string
- method kSecAttrCanDerive as string
- method kSecAttrCanEncrypt as string
- method kSecAttrCanSign as string
- method kSecAttrCanUnwrap as string
- method kSecAttrCanVerify as string
- method kSecAttrCanWrap as string
- method kSecAttrCertificateEncoding as string
- method kSecAttrCertificateType as string
- method kSecAttrComment as string
- method kSecAttrCreationDate as string
- method kSecAttrCreator as string
- method kSecAttrDescription as string
- method kSecAttrEffectiveKeySize as string
- method kSecAttrGeneric as string
- method kSecAttrIsInvisible as string
- method kSecAttrIsNegative as string
- method kSecAttrIsPermanent as string
- method kSecAttrIssuer as string
- method kSecAttrKeyClass as string
- method kSecAttrKeyClassPrivate as string
- method kSecAttrKeyClassPublic as string
- method kSecAttrKeyClassSymmetric as string
- method kSecAttrKeySizeInBits as string
- method kSecAttrKeyType as string
- method kSecAttrKeyType3DES as string
- method kSecAttrKeyTypeAES as string
- method kSecAttrKeyTypeCAST as string
- method kSecAttrKeyTypeDES as string
- method kSecAttrKeyTypeDSA as string
- method kSecAttrKeyTypeEC as string
- method kSecAttrKeyTypeECDSA as string
- method kSecAttrKeyTypeRC2 as string
- method kSecAttrKeyTypeRC4 as string
- method kSecAttrKeyTypeRSA as string
- method kSecAttrLabel as string
- method kSecAttrModificationDate as string
- method kSecAttrPath as string
- method kSecAttrPort as string
- method kSecAttrPRF as string
- method kSecAttrPRFHmacAlgSHA1 as string
- method kSecAttrPRFHmacAlgSHA224 as string
- method kSecAttrPRFHmacAlgSHA256 as string
- method kSecAttrPRFHmacAlgSHA384 as string
- method kSecAttrPRFHmacAlgSHA512 as string
- method kSecAttrProtocol as string
- method kSecAttrProtocolAFP as string
- method kSecAttrProtocolAppleTalk as string
- method kSecAttrProtocolDAAP as string
- method kSecAttrProtocolEPPC as string
- method kSecAttrProtocolFTP as string
- method kSecAttrProtocolFTPAccount as string
- method kSecAttrProtocolFTPProxy as string
- method kSecAttrProtocolFTPS as string
- method kSecAttrProtocolHTTP as string
- method kSecAttrProtocolHTTPProxy as string
- method kSecAttrProtocolHTTPS as string
- method kSecAttrProtocolHTTPSProxy as string
- method kSecAttrProtocolIMAP as string
- method kSecAttrProtocolIMAPS as string
- method kSecAttrProtocolIPP as string
- method kSecAttrProtocolIRC as string
- method kSecAttrProtocolIRCS as string
- method kSecAttrProtocolLDAP as string
- method kSecAttrProtocolLDAPS as string
- method kSecAttrProtocolNNTP as string
- method kSecAttrProtocolNNTPS as string
- method kSecAttrProtocolPOP3 as string
- method kSecAttrProtocolPOP3S as string
- method kSecAttrProtocolRTSP as string
- method kSecAttrProtocolRTSPProxy as string
- method kSecAttrProtocolSMB as string
- method kSecAttrProtocolSMTP as string
- method kSecAttrProtocolSOCKS as string
- method kSecAttrProtocolSSH as string
- method kSecAttrProtocolTelnet as string
- method kSecAttrProtocolTelnetS as string
- method kSecAttrPublicKeyHash as string
- method kSecAttrRounds as string
- method kSecAttrSalt as string
- method kSecAttrSecurityDomain as string
- method kSecAttrSerialNumber as string
- method kSecAttrServer as string
- method kSecAttrService as string
- method kSecAttrSubject as string
- method kSecAttrSubjectKeyID as string
- method kSecAttrSynchronizable as string
- method kSecAttrSynchronizableAny as string
- method kSecAttrType as string
- method kSecClass as string
- method kSecClassCertificate as string
- method kSecClassGenericPassword as string
- method kSecClassIdentity as string
- method kSecClassInternetPassword as string
- method kSecClassKey as string
- method kSecMatchCaseInsensitive as string
- method kSecMatchDiacriticInsensitive as string
- method kSecMatchEmailAddressIfPresent as string
- method kSecMatchIssuers as string
- method kSecMatchItemList as string
- method kSecMatchLimit as string
- method kSecMatchLimitAll as string
- method kSecMatchLimitOne as string
- method kSecMatchPolicy as string
- method kSecMatchSearchList as string
- method kSecMatchSubjectContains as string
- method kSecMatchSubjectEndsWith as string
- method kSecMatchSubjectStartsWith as string
- method kSecMatchSubjectWholeString as string
- method kSecMatchTrustedOnly as string
- method kSecMatchValidOnDate as string
- method kSecMatchWidthInsensitive as string
- method kSecReturnAttributes as string
- method kSecReturnData as string
- method kSecReturnPersistentRef as string
- method kSecReturnRef as string
- method kSecUseAuthenticationContext as string
- method kSecUseAuthenticationUI as string
- method kSecUseAuthenticationUIAllow as string
- method kSecUseAuthenticationUIFail as string
- method kSecUseAuthenticationUISkip as string
- method kSecUseItemList as string
- method kSecUseKeychain as string
- method kSecUseNoAuthenticationUI as string
- method kSecUseOperationPrompt as string
- method kSecValueData as string
- method kSecValuePersistentRef as string
- method kSecValueRef as string
- method LockAll
- method Open(file as folderitem) as KeychainMBS
- method Open(path as string) as KeychainMBS
- method PreferenceDomain as Integer
- method SearchCreateFromAttributes(keychain as KeychainMBS, itemClass as string, AttributeKeys() as string, AttributeValues() as string) as KeychainSearchMBS
- method SearchCreateFromAttributes(keychains() as KeychainMBS, itemClass as string, AttributeKeys() as string, AttributeValues() as string) as KeychainSearchMBS
- method SearchList as KeychainMBS()
- method SetDomainDefault(domain as Integer, keychain as KeychainMBS)
- method SetDomainSearchList(domain as Integer, list() as KeychainMBS)
- method SetSearchList(list() as KeychainMBS)
- method UpdateItem(Query as Dictionary, attributesToUpdate as dictionary) as boolean
- method UserInteractionAllowed as boolean
- method Version as Integer
- property LastError as Integer
- delegate AddItemAsyncCompletedMBS(Keychain as Variant, attributesDictionary as dictionary, Result as Variant, Lasterror as Integer, Tag as Variant)
- delegate CopyMatchingAsyncCompletedMBS(Query as Dictionary, Result as Variant, Lasterror as Integer, Tag as Variant)
- 16 constants
Constants
Constant | Value | Description |
---|---|---|
kSecAppleSharePasswordItemClass | "ashp" |
Specifies a keychain item's class code.
Indicates that the item is an AppleShare password. |
kSecGenericPasswordItemClass | "genp" |
Specifies a keychain item's class code.
Indicates that the item is a generic password. |
kSecInternetPasswordItemClass | "inet" |
Specifies a keychain item's class code.
Indicates that the item is an Internet password. |
Error Codes
Constant | Value | Description |
---|---|---|
ErrorAuthorizationFailed | -25293 |
The user name or passphrase you entered is not correct. |
ErrorDuplicatedItem | -25299 |
The specified item already exists in the keychain. |
ErrorFailedToAllocated | -108 |
Failed to allocate memory. |
ErrorFailedToDecode | -26275 |
Unable to decode the provided data. |
ErrorInteractionNotAllowed | -25308 |
User interaction is not allowed. |
ErrorInvalidParameter | -50 |
Invalid Parameters. |
ErrorNone | 0 |
No error. |
ErrorNotAvailable | -25291 |
No keychain is available. You may need to restart your computer. |
ErrorNotFound | -25300 |
The specified item could not be found in the keychain. |
Keychain Preference Domain Constants
Constant | Value | Description |
---|---|---|
kSecPreferencesDomainCommon | 2 |
Indicates the preferences are common to everyone. Available in OS X v10.3 and later. |
kSecPreferencesDomainDynamic | 3 |
Indicates a dynamic search list (typically provided by removable keychains such as smart cards). Available in OS X v10.4 and later. |
kSecPreferencesDomainSystem | 1 |
Indicates the system or daemon preference domain preferences. Available in OS X v10.3 and later. |
kSecPreferencesDomainUser | 0 |
Indicates the user preference domain preferences. Available in OS X v10.3 and later. |
Some examples which use this module:
- /MacClassic/Keychain/Keychain Content
- /MacClassic/Keychain/Keychain Pass Test
- /MacClassic/Keychain/Keychain Test
- /MacClassic/Keychain/KeyChain test iOS
Blog Entries
- MBS Xojo Plugins Version 21.0 News
- MBS Xojo Plugins, version 20.6pr1
- MBS Xojo Plugins, version 18.5pr6
- MBS Real Studio Plugins, version 13.1pr17
- MBS Real Studio Plugins, version 13.1pr12
Release notes
- Version 21.0
- Added new AddItem and AddItemAsync methods to KeychainManagerMBS class.
- Changed Keychain parameter in AddItemAsyncCompletedMBS event in KeychainManagerMBS class to variant.
- Version 18.5
- Added CopyMatchingAsync and AddItemAsync to KeychainManagerMBS class.
The items on this page are in the following plugins: MBS MacClassic Plugin.