GenericPasswordItem

public class GenericPasswordItem : AbstractPasswordItem

A generic password, that can be persisted securely in the systems Keychain.

A generic password is always used for a specified service, which can be your application itself. It might be tied to or used by an account.

Two generic password items are considered equal if their service and account values are equal.

Note

For internet passwords use InternetPassword instead.
  • The service for which the password is used. This can simply be your application.

    Declaration

    Swift

    public let service: String
  • Initialize a generic password Keychain item.

    Declaration

    Swift

    public init(for service: String, using account: String? = nil, with description: String? = nil, and comment: String? = nil)

    Parameters

    service

    A service, e.g., your application name.

    account

    The account for which the password is used.

    description

    A description or purpose of the item.

    comment

    A comment.