Class: WebAuthn::AttestationStatement::FidoU2f

Inherits:
Base
  • Object
show all
Defined in:
lib/webauthn/attestation_statement/fido_u2f.rb,
lib/webauthn/attestation_statement/fido_u2f/public_key.rb

Defined Under Namespace

Classes: PublicKey

Constant Summary collapse

VALID_ATTESTATION_CERTIFICATE_COUNT =
1
VALID_ATTESTATION_CERTIFICATE_ALGORITHM =
COSE::Algorithm.by_name("ES256")
VALID_ATTESTATION_CERTIFICATE_KEY_CURVE =
COSE::Key::Curve.by_name("P-256")

Constants inherited from Base

Base::AAGUID_EXTENSION_OID

Instance Method Summary collapse

Methods inherited from Base

#attestation_certificate, #attestation_certificate_key_id, #format, #initialize

Constructor Details

This class inherits a constructor from WebAuthn::AttestationStatement::Base

Instance Method Details

#valid?(authenticator_data, client_data_hash) ⇒ Boolean

Returns:

  • (Boolean)

15
16
17
18
19
20
21
22
23
# File 'lib/webauthn/attestation_statement/fido_u2f.rb', line 15

def valid?(authenticator_data, client_data_hash)
  valid_format? &&
    valid_certificate_public_key? &&
    valid_credential_public_key?(authenticator_data.credential.public_key) &&
    valid_aaguid?(authenticator_data.attested_credential_data.raw_aaguid) &&
    valid_signature?(authenticator_data, client_data_hash) &&
    trustworthy?(attestation_certificate_key_id: attestation_certificate_key_id) &&
    [attestation_type, attestation_trust_path]
end