FUIPasscodePolicy

public struct FUIPasscodePolicy

The passcode policy structure.

  • The default minimum length of characters in passcode is 8.

    Declaration

    Swift

    public static let passcodePolicyDefaultMinLength: Int
  • The default value for hasDigit of FUIPasscodePolicy is false.

    Declaration

    Swift

    public static let passcodePolicyDefaultHasDigit: Bool
  • The default value for hasUpper of FUIPasscodePolicy is false.

    Declaration

    Swift

    public static let passcodePolicyDefaultHasUpper: Bool
  • The default value for hasLower of FUIPasscodePolicy is false.

    Declaration

    Swift

    public static let passcodePolicyDefaultHasLower: Bool
  • The default value for hasSpecial of FUIPasscodePolicy is false.

    Declaration

    Swift

    public static let passcodePolicyDefaultHasSpecial: Bool
  • The default value for minUniqueChars of FUIPasscodePolicy is no limit.

    Declaration

    Swift

    public static let passcodePolicyDefaultMinUniqueChars: Int
  • The default value for retryLimit of FUIPasscodePolicy is no limit.

    Declaration

    Swift

    public static let passcodePolicyDefaultRetryLimit: Int
  • The default value for allowsTouchID of FUIPasscodePolicy is true.

    Declaration

    Swift

    public static let passcodePolicyDefaultAllowsTouchID: Bool
  • The default value for isDigitsOnly of FUIPasscodePolicy is false.

    Declaration

    Swift

    public static let passcodePolicyDefaultIsDigitsOnly: Bool
  • This value (-1) represents no limit in properties of type Int in FUIPasscodePolicy.

    Declaration

    Swift

    public static let passcodePolicyNoLimit: Int
  • The minimum number of characters in passcode. The validate function will return false if the length of the passcode is less than this minLength.

    Declaration

    Swift

    public var minLength: Int
  • Should passcode need to have digit. The validate function will return false if hasDigit is true and there is no digit in the passcode.

    Declaration

    Swift

    public var hasDigit: Bool
  • Should passcode need to have uppercase characters. The validate function will return false if hasUpper is true and there are no upper-case characters in the passcode.

    Declaration

    Swift

    public var hasUpper: Bool
  • Should passcode need to have lowercase characters. The validate function will return false if hasLower is true and there are no lower-case characters in the passcode.

    Declaration

    Swift

    public var hasLower: Bool
  • Should passcode need to have special characters. The validate function will return false if hasSpecial is true and there are no special characters in the passcode.

    Declaration

    Swift

    public var hasSpecial: Bool
  • How many unique characters should there be in the passcode. The validate function will return false if the number of unique characters in the passcode is less than minUniqueChars.

    Declaration

    Swift

    public var minUniqueChars: Int
  • How many retries are available to the user, before they are permanently locked-out.

    Declaration

    Swift

    public var retryLimit: Int
  • Allows the passcode to be stored in Touch ID protected keychain item.

    Declaration

    Swift

    public var allowsTouchID: Bool
  • The passcode should contain digit only if this property is true. All the hasDigit, hasUpper, hasLower, and hasSpecial will be ignored if this property is true.

    Declaration

    Swift

    public var isDigitsOnly: Bool
  • If this property is true, and isDigitsOnly is also true, the passcode digits entered is converted to Latin digits.

    The default is false.

    Declaration

    Swift

    public var isLocalizingDigitsToLatin: Bool
  • The lock timeout in seconds. The default is 0.

    If this property value is greater than 0, when user suspends the application and resumes after the timeout, the application should authenticate the user again. If user suspends the application and resumes before the timeout, the application does not need to authenticate user again.

    If this property value is 0, then application should aways authenticate the user when application resumes from suspend.

    Declaration

    Swift

    public var lockTimeout: Int
  • Init with default values.

    Declaration

    Swift

    public init()
  • Add a user defined passcode rule to the passcode policy.

    Declaration

    Swift

    public mutating func addPasscodeRule(passcodeRule: FUIPasscodeRule)

    Parameters

    passcodeRule

    The FUIPasscodeRule to be added to the passcode policy.

  • Validate a passcode against the policy.

    Declaration

    Swift

    public func validate(passcode: String) -> Bool

    Parameters

    passcode

    The passcode to be checked.

    Return Value

    True if validated.

  • Gets the number of required character groups for this policy based on the properties hasDigit, hasDigit, hasUpper, hasSpecial.

    Declaration

    Swift

    public func numberOfRequiredGroups() -> Int

    Return Value

    The number of required character groups for this policy.

  • convenience initializer using HCPms specific dictionary. Can be called with the root HCPms config or with the PasswordPolicy dictionary

    Declaration

    Swift

    public init?(hcpmsConfiguration param: [String : Any])
  • convenience initializer using HCPms specific PasswordPolicy dictionary

    Declaration

    Swift

    public init?(hcpmsPasscodePolicyDictionary dict: [String : Any])