Class: WebAuthn::AttestationStatement::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/webauthn/attestation_statement/base.rb

Direct Known Subclasses

AndroidKey, AndroidSafetynet, Apple, FidoU2f, None, Packed, TPM

Constant Summary collapse

AAGUID_EXTENSION_OID =
"1.3.6.1.4.1.45724.1.1.4"

Instance Method Summary collapse

Constructor Details

#initialize(statement, relying_party = WebAuthn.configuration.relying_party) ⇒ Base

Returns a new instance of Base.



31
32
33
34
# File 'lib/webauthn/attestation_statement/base.rb', line 31

def initialize(statement, relying_party = WebAuthn.configuration.relying_party)
  @statement = statement
  @relying_party = relying_party
end

Instance Method Details

#attestation_certificateObject



44
45
46
# File 'lib/webauthn/attestation_statement/base.rb', line 44

def attestation_certificate
  certificates&.first
end

#attestation_certificate_key_idObject



48
49
50
# File 'lib/webauthn/attestation_statement/base.rb', line 48

def attestation_certificate_key_id
  attestation_certificate.subject_key_identifier&.unpack("H*")&.[](0)
end

#formatObject



40
41
42
# File 'lib/webauthn/attestation_statement/base.rb', line 40

def format
  WebAuthn::AttestationStatement::FORMAT_TO_CLASS.key(self.class)
end

#valid?(_authenticator_data, _client_data_hash) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


36
37
38
# File 'lib/webauthn/attestation_statement/base.rb', line 36

def valid?(_authenticator_data, _client_data_hash)
  raise NotImplementedError
end