Class Requirement

java.lang.Object
se.swedenconnect.bankid.rpapi.types.Requirement

public class Requirement extends Object
Represents the structure in which a relying party can define how an authentication or signature process should be performed.

Note: It is recommended to use the Requirement.RequirementBuilder to construct a Requirement.

Author:
Martin Lindström
  • Field Details

    • CP_BANKID_ON_FILE

      public static final String CP_BANKID_ON_FILE
      Certificate policy Object Identifier - BankID on file (for production) should be used.
      See Also:
    • CP_BANKID_ON_SMARTCARD

      public static final String CP_BANKID_ON_SMARTCARD
      Certificate policy Object Identifier - BankID on smartcard (for production) should be used.
      See Also:
    • CP_MOBILE_BANKID

      public static final String CP_MOBILE_BANKID
      Certificate policy Object Identifier - Mobile BankID (for production) should be used.
      See Also:
    • CP_NORDEA_EID

      public static final String CP_NORDEA_EID
      Certificate policy Object Identifier - Nordea eID on file and smartcard (for production) should be used.
      See Also:
    • CP_BANKID_ON_FILE_TEST

      public static final String CP_BANKID_ON_FILE_TEST
      Certificate policy Object Identifier - BankID on file (for test) should be used.
      See Also:
    • CP_BANKID_ON_SMARTCARD_TEST

      public static final String CP_BANKID_ON_SMARTCARD_TEST
      Certificate policy Object Identifier - BankID on smartcard (for test) should be used.
      See Also:
    • CP_MOBILE_BANKID_TEST

      public static final String CP_MOBILE_BANKID_TEST
      Certificate policy Object Identifier - Mobile BankID (for test) should be used.
      See Also:
    • CP_NORDEA_EID_TEST

      public static final String CP_NORDEA_EID_TEST
      Certificate policy Object Identifier - Nordea eID on file and smartcard (for test) should be used.
      See Also:
    • CP_TEST_BANKID

      public static final String CP_TEST_BANKID
      Certificate policy Object Identifier - Test BankID for some BankID Banks.
      See Also:
  • Constructor Details

    • Requirement

      public Requirement()
  • Method Details

    • builder

      public static Requirement.RequirementBuilder builder()
      Creates a RequirementBuilder.
      Returns:
      a builder
    • builder

      public static Requirement.RequirementBuilder builder(Requirement req)
      Creates a RequirementBuilder given an already existing requirement.
      Parameters:
      req - the template requirement
      Returns:
      a builder
    • isEmpty

      public boolean isEmpty()
      Predicate that tells whether this object is "empty", meaning that no properties have been assigned.
      Returns:
      true if not properties have been assigned, and false otherwise
    • getPinCode

      public Boolean getPinCode()
      Gets the pin code requirement that tells whether users are required to sign the transaction with their PIN code, even if they have biometrics activated.
      Returns:
      whether pin code is required
    • setPinCode

      public void setPinCode(Boolean pinCode)
      Sets whether users are required to sign the transaction with their PIN code, even if they have biometrics activated.
      Parameters:
      pinCode - whether pin code is required
    • getMrtd

      public Boolean getMrtd()
      Gets the MRTD flag. If set to "true", the client needs to provide MRTD (Machine readable travel document) information to complete the order.Only Swedish passports and national ID cards are supported.
      Returns:
      the MRTD flag
    • setMrtd

      public void setMrtd(Boolean mrtd)
      Assigns the MRTD flag. If set to "true", the client needs to provide MRTD (Machine readable travel document) information to complete the order.Only Swedish passports and national ID cards are supported.
      Parameters:
      mrtd - the MRTD flag
    • getCardReader

      public Requirement.CardReaderRequirement getCardReader()
      Returns the requirement for which type of smart card reader that is required.
      Returns:
      the card reader requirement, or null
    • setCardReader

      public void setCardReader(Requirement.CardReaderRequirement cardReader)
      Assigns the requirement for which type of smart card reader that is required.

      This condition should be combined with a certificatePolicies for a smart card to avoid undefined behavior.

      Parameters:
      cardReader - the card reader requirement
    • getCertificatePolicies

      public List<String> getCertificatePolicies()
      Returns the certificate policies telling which types of BankID:s that should be supported.
      Returns:
      a list of certificate policy object identifiers
    • setCertificatePolicies

      public void setCertificatePolicies(List<String> certificatePolicies)
      Assigns the certificate policies telling which types of BankID:s that should be supported.

      It is recommended to use the Requirement.RequirementBuilder to set up certificate policies.

      Parameters:
      certificatePolicies - a list of certificate policy object identifiers
    • getPersonalNumber

      public String getPersonalNumber()
      Gets the personal eidentification number to be used to complete the transaction. If a BankID with another personal number attempts to sign the transaction, it fails.
      Returns:
      the personal number or null
    • setPersonalNumber

      public void setPersonalNumber(String personalNumber)
      Assigns the personal eidentification number to be used to complete the transaction. If a BankID with another personal number attempts to sign the transaction, it fails.
      Parameters:
      personalNumber - the personal number
    • toString

      public String toString()
      Overrides:
      toString in class Object