Class: WebAuthn::AuthenticatorAttestationResponse
- Inherits:
-
AuthenticatorResponse
- Object
- AuthenticatorResponse
- WebAuthn::AuthenticatorAttestationResponse
- Extended by:
- Forwardable
- Defined in:
- lib/webauthn/authenticator_attestation_response.rb
Instance Attribute Summary collapse
-
#attestation_trust_path ⇒ Object
readonly
Returns the value of attribute attestation_trust_path.
-
#attestation_type ⇒ Object
readonly
Returns the value of attribute attestation_type.
Class Method Summary collapse
Instance Method Summary collapse
- #attestation_object ⇒ Object
-
#initialize(attestation_object:, **options) ⇒ AuthenticatorAttestationResponse
constructor
A new instance of AuthenticatorAttestationResponse.
- #verify(expected_challenge, expected_origin = nil, user_verification: nil, rp_id: nil) ⇒ Object
Methods inherited from AuthenticatorResponse
Constructor Details
#initialize(attestation_object:, **options) ⇒ AuthenticatorAttestationResponse
Returns a new instance of AuthenticatorAttestationResponse.
30 31 32 33 34 |
# File 'lib/webauthn/authenticator_attestation_response.rb', line 30 def initialize(attestation_object:, **) super(**) @attestation_object_bytes = attestation_object end |
Instance Attribute Details
#attestation_trust_path ⇒ Object (readonly)
Returns the value of attribute attestation_trust_path.
28 29 30 |
# File 'lib/webauthn/authenticator_attestation_response.rb', line 28 def attestation_trust_path @attestation_trust_path end |
#attestation_type ⇒ Object (readonly)
Returns the value of attribute attestation_type.
28 29 30 |
# File 'lib/webauthn/authenticator_attestation_response.rb', line 28 def attestation_type @attestation_type end |
Class Method Details
.from_client(response) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/webauthn/authenticator_attestation_response.rb', line 19 def self.from_client(response) encoder = WebAuthn.configuration.encoder new( attestation_object: encoder.decode(response["attestationObject"]), client_data_json: encoder.decode(response["clientDataJSON"]) ) end |
Instance Method Details
#attestation_object ⇒ Object
47 48 49 |
# File 'lib/webauthn/authenticator_attestation_response.rb', line 47 def attestation_object @attestation_object ||= WebAuthn::AttestationObject.deserialize(attestation_object_bytes) end |
#verify(expected_challenge, expected_origin = nil, user_verification: nil, rp_id: nil) ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/webauthn/authenticator_attestation_response.rb', line 36 def verify(expected_challenge, expected_origin = nil, user_verification: nil, rp_id: nil) super verify_item(:attested_credential) if WebAuthn.configuration.verify_attestation_statement verify_item(:attestation_statement) end true end |