ex_bank_id v0.1.0 ExBankID.Sign.Payload

Provides the struct used when initiating a signing of data

Link to this section Summary

Functions

Constructs a new Sign Payload with the given ip-address, user visible data, and optionally personal number and user non visible data. user_visible_data and user_non_visible_data will be properly encode

Link to this section Functions

Link to this function

new(ip_address, user_visible_data, opts \\ [])

Specs

new(binary(), binary(),
  personal_number: String.t(),
  user_non_visible_data: String.t()
) ::
  {:error, String.t()}
  | %ExBankID.Sign.Payload{
      endUserIp: term(),
      personalNumber: term(),
      userNonVisibleData: term(),
      userVisibleData: term()
    }

Constructs a new Sign Payload with the given ip-address, user visible data, and optionally personal number and user non visible data. user_visible_data and user_non_visible_data will be properly encode

Examples

iex> ExBankID.Sign.Payload.new("1.1.1.1", "This will be visible in the bankID app") %ExBankID.Sign.Payload{endUserIp: "1.1.1.1", userVisibleData: "VGhpcyB3aWxsIGJlIHZpc2libGUgaW4gdGhlIGJhbmtJRCBhcHA="}

iex> ExBankID.Sign.Payload.new("1.1.1.1", "This will be visible in the bankID app", personal_number: "190000000000") %ExBankID.Sign.Payload{endUserIp: "1.1.1.1", personalNumber: "190000000000", userVisibleData: "VGhpcyB3aWxsIGJlIHZpc2libGUgaW4gdGhlIGJhbmtJRCBhcHA="}

iex> ExBankID.Sign.Payload.new("Not a valid ip address", "This will be visible in the bankID app", personal_number: "190000000000")