Class: WebAuthn::PublicKeyCredentialWithAssertion

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

Instance Attribute Summary

Attributes inherited from PublicKeyCredential

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PublicKeyCredential

#authenticator_extension_outputs, 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


31
32
33
# File 'lib/webauthn/public_key_credential_with_assertion.rb', line 31

def raw_user_handle
  response.user_handle
end

#user_handleObject


25
26
27
28
29
# File 'lib/webauthn/public_key_credential_with_assertion.rb', line 25

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

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


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

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

  response.verify(
    encoder.decode(challenge),
    public_key: encoder.decode(public_key),
    sign_count: sign_count,
    user_verification: user_verification
  )

  true
end