Record Class PhoneRequirement

java.lang.Object
java.lang.Record
dev.eidentification.bankid.client.model.PhoneRequirement
Record Components:
pinCode - Users are required to sign the transaction with their PIN code, even if they have biometrics activated.
cardReader - "class1" (default) – The transaction must be performed using a card reader where the PIN code is entered on a computer keyboard, or a card reader of higher class.

"class2" – The transaction must be performed using a card reader where the PIN code is entered on the reader, or a reader of higher class.

"no value" – defaults to "class1". This condition should be combined with a certificatePolicies for a smart card to avoid undefined behaviour.

certificatePolicies - The oid in certificate policies in the user certificate. List of String. One wildcard "" is allowed from position 5 and forward i.e. 1.2.752.78.

public record PhoneRequirement(@Nullable Boolean pinCode, @Nullable CardReader cardReader, @Nullable String certificatePolicies) extends Record
RP may use the requirement parameter to describe how a signature must be created and verified. A typical use case is to require Mobile BankID or a certain card reader. A requirement can be set for both auth and sign orders.

The class also provides a static method for creating instances of `PhoneRequirementBuilder`, which implements the Builder design pattern for easy creation of `PhoneRequirement` instances.

General usage is as follows: PhoneRequirement phoneRequirement = PhoneRequirement.builder() .pinCode(true) .cardReader(cardReaderInstance) .certificatePolicies(certificatePoliciesList) .build();

  • Constructor Details

    • PhoneRequirement

      public PhoneRequirement(@Nullable Boolean pinCode, @Nullable CardReader cardReader, @Nullable String certificatePolicies)
      Creates an instance of a PhoneRequirement record class.
      Parameters:
      pinCode - the value for the pinCode record component
      cardReader - the value for the cardReader record component
      certificatePolicies - the value for the certificatePolicies record component
  • Method Details

    • builder

      Creates a new instance of PhoneRequirementBuilder.
      Returns:
      a new instance of PhoneRequirementBuilder
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • pinCode

      public @Nullable Boolean pinCode()
      Returns the value of the pinCode record component.
      Returns:
      the value of the pinCode record component
    • cardReader

      public @Nullable CardReader cardReader()
      Returns the value of the cardReader record component.
      Returns:
      the value of the cardReader record component
    • certificatePolicies

      public @Nullable String certificatePolicies()
      Returns the value of the certificatePolicies record component.
      Returns:
      the value of the certificatePolicies record component