MonoMac.Security.SecKeyChain.AddInternetPassword Method
This method allows to add a new Internet password to the default keychain (MacOS only).

Syntax

public static SecStatusCode AddInternetPassword (string serverName, string accountName, byte[] password, SecProtocol protocolType, short port, string path, SecAuthenticationType authenticationType, string securityDomain)

Parameters

serverName
The server name for the Internet password.
accountName
The account name for the Internet password.
password
Array of bytes representing the password.
protocolType
Optional network protocol associated with the Internet password. If not provided, defaults to SecProtocol.Http.
port
Optional TCP/IP port associated with the Internet password. If not provided, defaults to 0.
path
Optional string which represents the path for the Internet password. If not provided, defaults to null.
authenticationType
Optional authentication type for the Internet password. If not provided, defaults to SecAuthenticationType.Default.
securityDomain
Optional security domain, if the protocol requires it. If not provided, defaults to null.

Returns

If the method succeeds, SecStatusCode.Success is returned. Otherwise the return value indicates the reason for the failure.

Remarks

This method can be used to add passwords to the default MacOS keychain for the Internet accounts. For any other types of accounts, use SecKeyChain.AddGenericPassword. If the password with the given serviceName or accountName already exist in the default keychain, the method will fail with the SecStatusCode.DuplicateItem return value. To update existing password, use SecKeyChain.Update. This method will cause the Unlock Keychain dialog box to be displayed, if the default keychain is currently locked. This method is not available for iOS.

Requirements

Namespace: MonoMac.Security
Assembly: XamMac (in XamMac.dll)
Assembly Versions: 0.0.0.0