Class: WebAuthn::PublicKeyCredentialWithAssertion

Inherits:
PublicKeyCredential show all
Defined in:
lib/webauthn/public_key_credential_with_assertion.rb

Instance Attribute Summary

Attributes inherited from PublicKeyCredential

#authenticator_attachment, #client_extension_outputs, #id, #raw_id, #response, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PublicKeyCredential

#authenticator_extension_outputs, #backed_up?, #backup_eligible?, from_client, #initialize, #sign_count

Constructor Details

This class inherits a constructor from WebAuthn::PublicKeyCredential

Class Method Details

.response_classObject



8
9
10
# File 'lib/webauthn/public_key_credential_with_assertion.rb', line 8

def self.response_class
  WebAuthn::AuthenticatorAssertionResponse
end

Instance Method Details

#raw_user_handleObject



33
34
35
# File 'lib/webauthn/public_key_credential_with_assertion.rb', line 33

def raw_user_handle
  response.user_handle
end

#user_handleObject



27
28
29
30
31
# File 'lib/webauthn/public_key_credential_with_assertion.rb', line 27

def user_handle
  if raw_user_handle
    encoder.encode(raw_user_handle)
  end
end

#verify(challenge, public_key:, sign_count:, user_presence: nil, user_verification: nil) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/webauthn/public_key_credential_with_assertion.rb', line 12

def verify(challenge, public_key:, sign_count:, user_presence: nil, user_verification: nil)
  super

  response.verify(
    encoder.decode(challenge),
    public_key: encoder.decode(public_key),
    sign_count: sign_count,
    user_presence: user_presence,
    user_verification: user_verification,
    rp_id: appid_extension_output ? appid : nil
  )

  true
end