pub unsafe extern "C-unwind" fn SecKeychainAddInternetPassword(
keychain: Option<&SecKeychain>,
server_name_length: u32,
server_name: *const c_char,
security_domain_length: u32,
security_domain: *const c_char,
account_name_length: u32,
account_name: *const c_char,
path_length: u32,
path: *const c_char,
port: u16,
protocol: SecProtocolType,
authentication_type: SecAuthenticationType,
password_length: u32,
password_data: NonNull<c_void>,
item_ref: *mut *mut SecKeychainItem,
) -> i32
SecKeychain
and SecBase
only.Expand description
Adds an Internet password to the specified keychain.
Parameter keychain
: A reference to a keychain in which to store an Internet password. Pass NULL to specify the user’s default keychain.
Parameter serverNameLength
: The length of the buffer pointed to by serverName.
Parameter serverName
: A pointer to a string containing the server name associated with this password.
Parameter securityDomainLength
: The length of the buffer pointed to by securityDomain.
Parameter securityDomain
: A pointer to a string containing the security domain associated with this password, or NULL if there is no relevant security domain.
Parameter accountNameLength
: The length of the buffer pointed to by accountName.
Parameter accountName
: A pointer to a string containing the account name associated with this password.
Parameter pathLength
: The length of the buffer pointed to by path.
Parameter path
: A pointer to a string containing the path associated with this password, or NULL if there is no relevant path string.
Parameter port
: The TCP/IP port number. If no specific port number is associated with this item, pass 0.
Parameter protocol
: The protocol associated with this password. See SecProtocolType for a description of possible values.
Parameter authenticationType
: The authentication scheme used. See SecAuthenticationType for a description of possible values. Pass the constant kSecAuthenticationTypeDefault to specify the default authentication scheme.
Parameter passwordLength
: The length of the buffer pointed to by passwordData.
Parameter passwordData
: A pointer to a buffer containing the password data to be stored in the keychain.
Parameter itemRef
: On return, a reference to the new keychain item.
Returns: A result code. See “Security Error Codes” (SecBase.h).
The SecKeychainAddInternetPassword function adds a new Internet server password to the specified keychain. Required parameters to identify the password are serverName and accountName (you cannot pass NULL for both parameters). In addition, some protocols may require an optional securityDomain when authentication is requested. SecKeychainAddInternetPassword optionally returns a reference to the newly added item.