MonoMac.Security.SecKeyChain.AddGenericPassword Method
The method allows to add a new generic password to the default keychain (MacOS only).

Syntax

public static SecStatusCode AddGenericPassword (string serviceName, string accountName, byte[] password)

Parameters

serviceName
The name of the service for the generic password.
accountName
The name of the account for the generic password.
password
Array of bytes representing the password.

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 various types of accounts other than the Internet: databases, network shares and so on. 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