None.php 950 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace lbuchs\WebAuthn\Attestation\Format;
  3. use lbuchs\WebAuthn\Attestation\AuthenticatorData;
  4. use lbuchs\WebAuthn\WebAuthnException;
  5. class None extends FormatBase {
  6. public function __construct($AttestionObject, AuthenticatorData $authenticatorData) {
  7. parent::__construct($AttestionObject, $authenticatorData);
  8. }
  9. /*
  10. * returns the key certificate in PEM format
  11. * @return string
  12. */
  13. public function getCertificatePem() {
  14. return null;
  15. }
  16. /**
  17. * @param string $clientDataHash
  18. */
  19. public function validateAttestation($clientDataHash) {
  20. return true;
  21. }
  22. /**
  23. * validates the certificate against root certificates.
  24. * Format 'none' does not contain any ca, so always false.
  25. * @param array $rootCas
  26. * @return boolean
  27. * @throws WebAuthnException
  28. */
  29. public function validateRootCertificate($rootCas) {
  30. return false;
  31. }
  32. }