Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

KeychainItemMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class Keychain MBS MacClassic Plugin 13.1 Yes No No Yes, macOS only No
Function: 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

Feedback, Comments & Corrections

Keychain Attribute Names

Constant Value Description
kSecAccountItemAttr "acct" Identifies the account attribute.
You use this tag to set or get a string that represents the user account. It also applies to generic, Internet, and AppleShare password items. Keychain strings should use UTF-8 encoding.
kSecAddressItemAttr "addr" Identifies the address attribute.
You use this tag to set or get a value of type string that represents the AppleTalk zone name, or the IP or domain name that represents the server address. This is unique to AppleShare password attributes. Keychain strings should use UTF-8 encoding.
kSecAlias "alis" Indicates an alias.
kSecAuthenticationTypeItemAttr "atyp" Identifies the authentication type attribute.
You use this tag to set or get a value of type SecAuthenticationType that represents the Internet authentication scheme. For possible authentication values, see "Keychain Authentication Type Constants." This is unique to Internet password attributes.
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.
You use this tag to get a string value that represents the date the item was created, expressed in Zulu Time format ("YYYYMMDDhhmmssZ"). This is the native format for stored time values in the CDSA specification (defined as CSSM_DB_ATTRIBUTE_FORMAT_TIME_DATE in the CSSM_DB_ATTRIBUTE_FORMAT enumeration, Section 17.2.6.). When specifying the creation date as input to a function (for example, SecKeychainSearchCreateFromAttributes), you may alternatively provide a numeric value of type UInt32 or SInt64, expressed as seconds since 01 January 1904.
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.
You use this tag to set or get a string value that represents a user-visible string describing this particular kind of item, for example "disk image password". Keychain strings should use UTF-8 encoding.
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.
You use this tag to get a string value that represents the date the item was created, expressed in Zulu Time format ("YYYYMMDDhhmmssZ"). This is the native format for stored time values in the CDSA specification (defined as CSSM_DB_ATTRIBUTE_FORMAT_TIME_DATE in the CSSM_DB_ATTRIBUTE_FORMAT enumeration, Section 17.2.6.). When specifying the creation date as input to a function (for example, SecKeychainSearchCreateFromAttributes), you may alternatively provide a numeric value of type UInt32 or SInt64, expressed as seconds since 01 January 1904.
kSecNegativeItemAttr "nega" Identifies the negative attribute.
You use this tag to set or get a value of type Boolean that indicates whether there is a valid password associated with this keychain item. This is useful if your application doesn't want a password for some particular service to be stored in the keychain, but prefers that it always be entered by the user. The item, which is typically invisible and with zero-length data, acts as a placeholder.
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.
You use this tag to set or get a value of type SecProtocolType that represents the Internet protocol. For possible protocol type values, see "Keychain Protocol Type Constants." This is unique to AppleShare and Internet password attributes.
kSecScriptCodeItemAttr "scrp" Identifies the script code attribute.
You use this tag to set or get a value of type ScriptCode that represents the script code for all strings. Use of this attribute is deprecated; string attributes should always be stored in UTF-8 encoding.
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.
You use this tag to set or get a string that represents the Internet server's domain name or IP address. This is unique to Internet password attributes. Keychain strings should use UTF-8 encoding.
kSecServiceItemAttr "svce" Identifies the service attribute.
You use this tag to set or get a string that represents the service associated with this item, for example, "iTools". This is unique to generic password attributes. Keychain strings should use UTF-8 encoding.
kSecSignatureItemAttr "ssig" Identifies the server signature attribute.
You use this tag to set or get a value of type SecAFPServerSignature that represents the server signature block. This is unique to AppleShare password attributes.
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.
You use this tag to set or get a string value that represents the AppleShare volume. This is unique to AppleShare password attributes. Keychain strings should use UTF-8 encoding.

This class has no sub classes.

Some methods using this class:

Some examples which use this class:


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


KeychainAccessControlMBS   -   KeychainMBS




Links
MBS FileMaker Plugins