Class: RubyHome::VerifySRPService

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_home/http/services/verify_srp_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(device_proof:, public_key:, srp_session:) ⇒ VerifySRPService

Returns a new instance of VerifySRPService.



3
4
5
6
7
# File 'lib/ruby_home/http/services/verify_srp_service.rb', line 3

def initialize(device_proof: , public_key: , srp_session: )
  @device_proof_bytes = device_proof.to_s.unpack1('H*')
  @public_key_bytes = public_key.to_s.unpack1('H*')
  @srp_session = srp_session
end

Instance Method Details

#runObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ruby_home/http/services/verify_srp_service.rb', line 9

def run
  if valid_session?
    OpenStruct.new(
      success?: true,
      session_key: session_key,
      server_proof: verify_session_bytes
    )
  else
    OpenStruct.new(success?: false)
  end
end