Module: WebAuthn::AttestationStatement

Defined in:
lib/webauthn/attestation_statement/packed.rb,
lib/webauthn/attestation_statement.rb,
lib/webauthn/attestation_statement/tpm.rb,
lib/webauthn/attestation_statement/base.rb,
lib/webauthn/attestation_statement/none.rb,
lib/webauthn/attestation_statement/apple.rb,
lib/webauthn/attestation_statement/fido_u2f.rb,
lib/webauthn/attestation_statement/android_key.rb,
lib/webauthn/attestation_statement/android_safetynet.rb,
lib/webauthn/attestation_statement/fido_u2f/public_key.rb

Overview

Defined Under Namespace

Classes: AndroidKey, AndroidSafetynet, Apple, Base, FidoU2f, FormatNotSupportedError, None, Packed, TPM, UnsupportedAlgorithm

Constant Summary collapse

ATTESTATION_FORMAT_NONE =
"none"
ATTESTATION_FORMAT_FIDO_U2F =
"fido-u2f"
ATTESTATION_FORMAT_PACKED =
'packed'
ATTESTATION_FORMAT_ANDROID_SAFETYNET =
"android-safetynet"
ATTESTATION_FORMAT_ANDROID_KEY =
"android-key"
ATTESTATION_FORMAT_TPM =
"tpm"
ATTESTATION_FORMAT_APPLE =
"apple"
FORMAT_TO_CLASS =
{
  ATTESTATION_FORMAT_NONE => WebAuthn::AttestationStatement::None,
  ATTESTATION_FORMAT_FIDO_U2F => WebAuthn::AttestationStatement::FidoU2f,
  ATTESTATION_FORMAT_PACKED => WebAuthn::AttestationStatement::Packed,
  ATTESTATION_FORMAT_ANDROID_SAFETYNET => WebAuthn::AttestationStatement::AndroidSafetynet,
  ATTESTATION_FORMAT_ANDROID_KEY => WebAuthn::AttestationStatement::AndroidKey,
  ATTESTATION_FORMAT_TPM => WebAuthn::AttestationStatement::TPM,
  ATTESTATION_FORMAT_APPLE => WebAuthn::AttestationStatement::Apple
}.freeze
ATTESTATION_TYPE_NONE =
"None"
ATTESTATION_TYPE_BASIC =
"Basic"
ATTESTATION_TYPE_SELF =
"Self"
ATTESTATION_TYPE_ATTCA =
"AttCA"
ATTESTATION_TYPE_BASIC_OR_ATTCA =
"Basic_or_AttCA"
ATTESTATION_TYPE_ANONCA =
"AnonCA"
ATTESTATION_TYPES_WITH_ROOT =
[
  ATTESTATION_TYPE_BASIC,
  ATTESTATION_TYPE_BASIC_OR_ATTCA,
  ATTESTATION_TYPE_ATTCA,
  ATTESTATION_TYPE_ANONCA
].freeze

Class Method Summary collapse

Class Method Details

.from(format, statement) ⇒ Object


34
35
36
37
38
39
40
41
42
# File 'lib/webauthn/attestation_statement.rb', line 34

def self.from(format, statement)
  klass = FORMAT_TO_CLASS[format]

  if klass
    klass.new(statement)
  else
    raise(FormatNotSupportedError, "Unsupported attestation format '#{format}'")
  end
end