class WebAuthn::AttestationObject

Attributes

attestation_statement[R]
authenticator_data[R]

Public Class Methods

deserialize(attestation_object) click to toggle source
# File lib/webauthn/attestation_object.rb, line 13
def self.deserialize(attestation_object)
  from_map(CBOR.decode(attestation_object))
end
from_map(map) click to toggle source
# File lib/webauthn/attestation_object.rb, line 17
def self.from_map(map)
  new(
    authenticator_data: WebAuthn::AuthenticatorData.deserialize(map["authData"]),
    attestation_statement: WebAuthn::AttestationStatement.from(map["fmt"], map["attStmt"])
  )
end
new(authenticator_data:, attestation_statement:) click to toggle source
# File lib/webauthn/attestation_object.rb, line 26
def initialize(authenticator_data:, attestation_statement:)
  @authenticator_data = authenticator_data
  @attestation_statement = attestation_statement
end

Public Instance Methods

valid_attestation_statement?(client_data_hash) click to toggle source
# File lib/webauthn/attestation_object.rb, line 36
def valid_attestation_statement?(client_data_hash)
  attestation_statement.valid?(authenticator_data, client_data_hash)
end
valid_attested_credential?() click to toggle source
# File lib/webauthn/attestation_object.rb, line 31
def valid_attested_credential?
  authenticator_data.attested_credential_data_included? &&
    authenticator_data.attested_credential_data.valid?
end