Platforms to show: All Mac Windows Linux Cross-Platform

KeychainItemMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Keychain MBS MacClassic Plugin 13.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The class for a keychain item.
Example
Const kDomain = "koingosw.com"
Const kUsername = "koingosoftware"
Const kPath = ""
Const kProtocol = "http"

Dim xPassword As MemoryBlock = "testpassword"
Dim xAdded As KeychainItemMBS

Dim dQuery as new Dictionary
dQuery.Value(KeychainManagerMBS.kSecAttrAuthenticationType) = KeychainManagerMBS.kSecAttrAuthenticationTypeHTMLForm
dQuery.Value(KeychainManagerMBS.kSecClass) = KeychainManagerMBS.kSecClassInternetPassword
If Len(kDomain) <> 0 Then dQuery.Value(KeychainManagerMBS.kSecAttrServer) = kDomain
If Len(kUsername) <> 0 Then dQuery.Value(KeychainManagerMBS.kSecAttrAccount) = kUsername
If Len(kProtocol) <> 0 Then dQuery.Value(KeychainManagerMBS.kSecAttrProtocol) = kProtocol
dQuery.Value(KeychainManagerMBS.kSecAttrComment) = "default"
dQuery.Value(KeychainManagerMBS.kSecAttrDescription) = "Web form password"
dQuery.Value(KeychainManagerMBS.kSecAttrLabel) = kDomain + " (" + kUsername + ")"
dQuery.Value(KeychainManagerMBS.kSecValueData) = xPassword

If Not KeychainManagerMBS.AddItem(KeychainManagerMBS.Default,dQuery) Then
Break
End If

Keychain Attribute Names

Constant Value Description
kSecAccountItemAttr "acct" Identifies the account attribute. more
kSecAddressItemAttr "addr" Identifies the address attribute. more
kSecAlias "alis" Indicates an alias.
kSecAuthenticationTypeItemAttr "atyp" Identifies the authentication type attribute. more
kSecCertificateEncoding "cenc" Indicates a CSSM_CERT_ENCODING type.
kSecCertificateType "ctyp" Indicates a CSSM_CERT_TYPE type.
kSecCommentItemAttr "icmt" Identifies the comment attribute.
You use this tag to set or get a string value that represents a user-editable string containing comments for this item. Keychain strings should use UTF-8 encoding.
kSecCreationDateItemAttr "cdat" Identifies the creation date attribute. more
kSecCreatorItemAttr "crtr" Identifies the creator attribute.
You use this tag to set or get a value of type FourCharCode that represents the item's creator.
kSecCrlEncoding "crnc" Indicates a CSSM_CRL_ENCODING type.
kSecCrlType "crtp" Indicates a CSSM_CRL_TYPE type.
kSecCustomIconItemAttr "cusi" Identifies the custom icon attribute.
Use of this attribute is deprecated. Custom icons for keychains are not supported in OS X.
kSecDescriptionItemAttr "desc" Identifies the description attribute. more
kSecGenericItemAttr "gena" Identifies the generic attribute.
You use this tag to set or get a value of untyped bytes that represents a user-defined attribute. This is unique to generic password attributes.
kSecInvisibleItemAttr "invi" Identifies the invisible attribute.
You use this tag to set or get a value of type Boolean that indicates whether the item is invisible (that is, should not be displayed).
kSecLabelItemAttr "labl" Identifies the label attribute.
You use this tag to set or get a string value that represents a user-editable string containing the label for this item. Keychain strings should use UTF-8 encoding.
kSecModDateItemAttr "mdat" Identifies the modification date attribute. more
kSecNegativeItemAttr "nega" Identifies the negative attribute. more
kSecPathItemAttr "path" Identifies the path attribute.
You use this tag to set or get a string value that represents the path. This is unique to Internet password attributes. Keychain strings should use UTF-8 encoding.
kSecPortItemAttr "port" Identifies the port attribute.
You use this tag to set or get a value of type UInt32 that represents the Internet port number. This is unique to Internet password attributes.
kSecProtocolItemAttr "ptcl" Identifies the protocol attribute. more
kSecScriptCodeItemAttr "scrp" Identifies the script code attribute. more
kSecSecurityDomainItemAttr "sdmn" Identifies the security domain attribute.
You use this tag to set or get a value that represents the Internet security domain. This is unique to Internet password attributes.
kSecServerItemAttr "srvr" Identifies the server attribute. more
kSecServiceItemAttr "svce" Identifies the service attribute. more
kSecSignatureItemAttr "ssig" Identifies the server signature attribute. more
kSecTypeItemAttr "type" Identifies the type attribute.
You use this tag to set or get a value of type FourCharCode that represents the item's type.
kSecVolumeItemAttr "vlme" Identifies the volume attribute. more

This class has no sub classes.

Some methods using this class:

Some examples using this class:

Blog Entries


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


KeychainAccessControlMBS   -   KeychainMBS


The biggest plugin in space...