Record Class Configuration

java.lang.Object
java.lang.Record
dev.eidentification.bankid.configuration.Configuration
Record Components:
baseURL - the base url to either the test or production environment
pkcs12 - the pkcs12 context required for authentication
certificate - the certificate in form of an input stream

public record Configuration(String baseURL, Pkcs12 pkcs12, InputStream certificate) extends Record
This record encapsulates the configuration required for a BankId client.

Represents essential information for interacting with the BankId system. The primary components of this configuration are the base URL, PKCS12 authentication details, and the requisite certificate. The base URL directs the client to the BankId system. PKCS12 information consists of the necessary authentication credentials. The required certificate ensures secure access to the BankId system.

Provides two static URLs for interacting with the production and test environments of the BankId system: URL_PRODUCTION: URL for the production environment, URL_TEST: URL for the test environment.

  • Field Details

  • Constructor Details

    • Configuration

      public Configuration(String baseURL, Pkcs12 pkcs12, InputStream certificate)
      Creates an instance of a Configuration record class.
      Parameters:
      baseURL - the value for the baseURL record component
      pkcs12 - the value for the pkcs12 record component
      certificate - the value for the certificate record component
  • Method Details

    • of

      public static Configuration of(String baseURL, Pkcs12 pkcs12, InputStream certificate)
      Creates a new Configuration object with the provided base URL, PKCS12 information, and certificate.
      Parameters:
      baseURL - the base URL used to interact with the BankID system
      pkcs12 - the PKCS12 information required for authentication
      certificate - the certificate required for authentication
      Returns:
      a new Configuration object
    • toString

      public 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
    • builder

      public static Configuration.ConfigurationBuilder builder()
    • 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.
    • baseURL

      public String baseURL()
      Returns the value of the baseURL record component.
      Returns:
      the value of the baseURL record component
    • pkcs12

      public Pkcs12 pkcs12()
      Returns the value of the pkcs12 record component.
      Returns:
      the value of the pkcs12 record component
    • certificate

      public InputStream certificate()
      Returns the value of the certificate record component.
      Returns:
      the value of the certificate record component