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) ⇒ Base

Returns a new instance of Base.


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

def initialize(statement)
  @statement = statement
end

Instance Method Details

#attestation_certificateObject


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

def attestation_certificate
  certificates&.first
end

#attestation_certificate_key_idObject


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

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

#formatObject


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

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

#valid?(_authenticator_data, _client_data_hash) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)

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

def valid?(_authenticator_data, _client_data_hash)
  raise NotImplementedError
end