Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.
   1  <?php
   2  
   3  
   4  namespace lbuchs\WebAuthn\Attestation\Format;
   5  use lbuchs\WebAuthn\Attestation\AuthenticatorData;
   6  use lbuchs\WebAuthn\WebAuthnException;
   7  
   8  class None extends FormatBase {
   9  
  10  
  11      public function __construct($AttestionObject, AuthenticatorData $authenticatorData) {
  12          parent::__construct($AttestionObject, $authenticatorData);
  13      }
  14  
  15  
  16      /*
  17       * returns the key certificate in PEM format
  18       * @return string
  19       */
  20      public function getCertificatePem() {
  21          return null;
  22      }
  23  
  24      /**
  25       * @param string $clientDataHash
  26       */
  27      public function validateAttestation($clientDataHash) {
  28          return true;
  29      }
  30  
  31      /**
  32       * validates the certificate against root certificates.
  33       * Format 'none' does not contain any ca, so always false.
  34       * @param array $rootCas
  35       * @return boolean
  36       * @throws WebAuthnException
  37       */
  38      public function validateRootCertificate($rootCas) {
  39          return false;
  40      }
  41  }