Platforms to show: All Mac Windows Linux Cross-Platform

Back to KeychainItemMBS class.

KeychainItemMBS.Account as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Keychain MBS MacClassic Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Convenience property to get/set the account attribute as UTF-8 text.
Example
dim ServiceName as string = "mytest"
dim Username as string = "myusername"
dim keychain as KeychainMBS = nil // use default

dim item as KeychainItemMBS = KeychainManagerMBS.FindGenericItem(keychain, ServiceName, Username)

MsgBox "Label: "+item.label+EndOfLine+_
"Comment: "+item.comment+EndOfLine+_
"Account: "+item.Account

Lasterror is set.
(Read and Write computed property)

KeychainItemMBS.AttributeData(attributeName as string) as memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Keychain MBS MacClassic Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Get or set an attribute as raw data (memoryblock).
Example
dim ServiceName as string = "mytest"
dim Username as string = "myusername"
dim keychain as KeychainMBS = nil // use default

dim item as KeychainItemMBS = KeychainManagerMBS.FindGenericItem(keychain, ServiceName, Username)

dim data as MemoryBlock = item.AttributeData(item.kSecCreationDateItemAttr)
dim text as string = DefineEncoding(data, encodings.UTF8)
MsgBox text

Lasterror is set.
(Read and Write computed property)

KeychainItemMBS.AttributeText(attributeName as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Keychain MBS MacClassic Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Get or set an attribute as an UTF-8 text.
Example
dim ServiceName as string = "mytest"
dim Username as string = "myusername"
dim keychain as KeychainMBS = nil // use default

dim item as KeychainItemMBS = KeychainManagerMBS.FindGenericItem(keychain, ServiceName, Username)

dim text as string = item.AttributeText(item.kSecCreationDateItemAttr)
MsgBox text

Lasterror is set.
(Read and Write computed property)

KeychainItemMBS.Comment as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Keychain MBS MacClassic Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Convenience property to get/set the comment attribute as UTF-8 text.
Example
dim ServiceName as string = "mytest"
dim Username as string = "myusername"
dim keychain as KeychainMBS = nil // use default

dim item as KeychainItemMBS = KeychainManagerMBS.FindGenericItem(keychain, ServiceName, Username)

MsgBox "Label: "+item.label+EndOfLine+_
"Comment: "+item.comment+EndOfLine+_
"Account: "+item.Account

Lasterror is set.
(Read and Write computed property)

KeychainItemMBS.Delete

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Keychain MBS MacClassic Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Deletes a keychain item from the default keychain's permanent data store.

Lasterror is set.

KeychainItemMBS.Description as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Keychain MBS MacClassic Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Convenience property to get/set the description attribute as UTF-8 text.
Example
dim ServiceName as string = "mytest"
dim Username as string = "myusername"
dim keychain as KeychainMBS = nil // use default

dim item as KeychainItemMBS = KeychainManagerMBS.FindGenericItem(keychain, ServiceName, Username)
MsgBox item.Description

Lasterror is set.
(Read and Write computed property)

KeychainItemMBS.ItemClass as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Keychain MBS MacClassic Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Queries the item class for this item.
Example
dim ServiceName as string = "mytest"
dim Username as string = "myusername"
dim keychain as KeychainMBS = nil // use default

dim item as KeychainItemMBS = KeychainManagerMBS.FindGenericItem(keychain, ServiceName, Username)
MsgBox item.itemclass // shows genp for generic password

Lasterror is set.

KeychainItemMBS.Keychain as KeychainMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Keychain MBS MacClassic Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the keychain object of a given keychain item.

Lasterror is set.

Some examples using this method:

KeychainItemMBS.Label as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Keychain MBS MacClassic Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Convenience property to get/set the label attribute as UTF-8 text.
Example
dim items() as KeychainItemMBS = KeychainManagerMBS.AllItems(nil, KeychainManagerMBS.kSecGenericPasswordItemClass)
dim labels() as string

for each item as KeychainItemMBS in items
labels.append item.label
next

break // see array of labels

Lasterror is set.
(Read and Write computed property)

KeychainItemMBS.Password as memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Keychain MBS MacClassic Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Queries the password or sets a new one.
Example
dim ServiceName as string = "mytest"
dim Username as string = "myusername"
dim keychain as KeychainMBS = nil // use default

dim item as KeychainItemMBS = KeychainManagerMBS.FindGenericItem(keychain, ServiceName, Username)

dim passwordData as MemoryBlock = item.Password
dim password as string = DefineEncoding(passwordData, encodings.UTF8)
MsgBox Password

Lasterror is set.
(Read and Write computed property)

KeychainItemMBS.PersistentReference as Memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Keychain MBS MacClassic Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a persistent reference for a keychain item.

Unlike normal references, a persistent reference may be stored on disk or passed between processes. You can convert a persistent reference into an ordinary keychain item reference (KeychainItemMBS) by calling the KeychainManagerMBS.ItemFromPersistentReference function.
Lasterror is set.

KeychainItemMBS.Service as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Keychain MBS MacClassic Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Convenience property to get/set the service attribute as UTF-8 text.
Example
dim ServiceName as string = "mytest"
dim Username as string = "myusername"
dim keychain as KeychainMBS = nil // use default

dim item as KeychainItemMBS = KeychainManagerMBS.FindGenericItem(keychain, ServiceName, Username)
MsgBox item.Service

Lasterror is set.
(Read and Write computed property)

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


The biggest plugin in space...