Class: NemID::Authentication::Params

Inherits:
Object
  • Object
show all
Defined in:
lib/nemid/authentication/params.rb

Instance Method Summary collapse

Constructor Details

#initialize(cert:, key:) ⇒ Params

Returns a new instance of Params.



6
7
8
# File 'lib/nemid/authentication/params.rb', line 6

def initialize(cert:, key:)
  @nemid_crypto = NemID::Crypto.new(cert: cert, key: key)
end

Instance Method Details

#client_initialization_parametersObject



10
11
12
13
14
15
16
17
18
# File 'lib/nemid/authentication/params.rb', line 10

def client_initialization_parameters
  params = unsigned_params
  normalized_unsigned_params = normalize(unsigned_params)
  
  params.merge({
    "DIGEST_SIGNATURE": digest_signature(normalized_unsigned_params),
    "PARAMS_DIGEST": params_digest(normalized_unsigned_params),
  })
end