CredentialCache

public final class CredentialCache

Cache for securely storing credentials in the keychain

  • Initializes an instance of credential cache

    Declaration

    Swift

    public init()
  • Retrieves the credentials for a specified contract id, if available

    Declaration

    Swift

    public func credentials(for contractId: String) -> Credentials?

    Parameters

    contractId

    The contract identifier relating to the stored credentials

    Return Value

    The credentials, if found, or nil if not found

  • Sets the credentials for the specified contract identifier

    Declaration

    Swift

    public func setCredentials(_ credentials: Credentials?, for contractId: String)

    Parameters

    credentials

    The credentials relating to the contract identifier. If nil, removes the entry for the contract.

    contractId

    The contract identifier

  • Clear credentials for the specified contract identifier

    Declaration

    Swift

    @discardableResult
    public func clearCredentials(for contractId: String) -> Bool

    Parameters

    contractId

    The contract identifier