Sha256: 58500824d28aeca6dadadc8c77109424043636031d2588eb6f18ee05bda44968

Contents?: true

Size: 666 Bytes

Versions: 15

Compression:

Stored size: 666 Bytes

Contents

# frozen_string_literal: true

require "webauthn/authenticator_attestation_response"
require "webauthn/public_key_credential"

module WebAuthn
  class PublicKeyCredentialWithAttestation < PublicKeyCredential
    def self.response_class
      WebAuthn::AuthenticatorAttestationResponse
    end

    def verify(challenge, user_verification: nil)
      super

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

      true
    end

    def public_key
      if raw_public_key
        encoder.encode(raw_public_key)
      end
    end

    def raw_public_key
      response&.authenticator_data&.credential&.public_key
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
webauthn-3.1.0 lib/webauthn/public_key_credential_with_attestation.rb
webauthn-3.0.0 lib/webauthn/public_key_credential_with_attestation.rb
webauthn-3.0.0.alpha2 lib/webauthn/public_key_credential_with_attestation.rb
webauthn-2.5.2 lib/webauthn/public_key_credential_with_attestation.rb
webauthn-2.5.1 lib/webauthn/public_key_credential_with_attestation.rb
webauthn-2.5.0 lib/webauthn/public_key_credential_with_attestation.rb
webauthn-2.4.1 lib/webauthn/public_key_credential_with_attestation.rb
webauthn-2.4.0 lib/webauthn/public_key_credential_with_attestation.rb
webauthn-3.0.0.alpha1 lib/webauthn/public_key_credential_with_attestation.rb
webauthn-2.3.0 lib/webauthn/public_key_credential_with_attestation.rb
webauthn-2.2.1 lib/webauthn/public_key_credential_with_attestation.rb
webauthn-2.2.0 lib/webauthn/public_key_credential_with_attestation.rb
webauthn-2.1.0 lib/webauthn/public_key_credential_with_attestation.rb
webauthn-2.0.0 lib/webauthn/public_key_credential_with_attestation.rb
webauthn-2.0.0.beta1 lib/webauthn/public_key_credential_with_attestation.rb