PinConstraint

public final class PinConstraint

Class that describes the format constraints of the PIN (which must be enforced when changing the PIN value).

The constraints are obtained as an Array of PinConstraint objects by calling Pin.getConstraints(completionHandler:).

The PinConstraint objects, that describe a constraint, all have a field named type. This field indicates the type of the constraint, and optionally, the parameters of the constraint. The type can be one of the following (this list may be extended in the future):

  • "minLength": The number of characters in the PIN must be at least the number given by the first parameter.
  • "exactLength": The number of characters in the PIN must be exactly the number given by the first parameter.
  • "minMaxLength": The number of characters in the PIN must be between the first parameter and the second parameter.
  • "minDigits": The PIN must contain at least the number of the first parameter digits characters.
  • "minUpperCase": The PIN must contain at least the number of uppercase letters given by the first parameter.
  • "minSpecial": The PIN must contain at least the number of special characters given by the first parameter.
  • "minLowerCase": The PIN must contain at least the number of lowercase letters given by the first parameter.
  • "newOldDifferent": The new PIN value must be different from the old PIN value.
  • "newOldDissimilar": The percentage of the characters that must differ between the new PIN and the old PIN value is given in the first parameter.
  • "maxIncDecSequence": There must be no sequences of increasing/decreasing characters that reach or exceed the first parameter.
  • "maxIdenticalSequence": The max Identical sequence between the new PIN and the Old pin
  • Gets the type of the constraint.

    Declaration

    Swift

    public func getType() -> String

    Return Value

    The type of the constraint.

  • Gets the parameters of the constraint.

    Declaration

    Swift

    public func getParameters() -> Array<Int>?

    Return Value

    The parameters of the constraint, or nil if the constraints has no parameter.