RegistrationRequest.php 1004 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Created by IntelliJ IDEA.
  4. * User: samuel
  5. * Date: 09/12/2016
  6. * Time: 14:48
  7. */
  8. namespace Samyoul\U2F\U2FServer;
  9. class RegistrationRequest implements \JsonSerializable
  10. {
  11. /** Protocol version */
  12. protected $version = U2FServer::VERSION;
  13. /** Registration challenge */
  14. protected $challenge;
  15. /** Application id */
  16. protected $appId;
  17. /**
  18. * @param string $challenge
  19. * @param string $appId
  20. */
  21. public function __construct($challenge, $appId)
  22. {
  23. $this->challenge = $challenge;
  24. $this->appId = $appId;
  25. }
  26. public function version()
  27. {
  28. return $this->version;
  29. }
  30. public function challenge()
  31. {
  32. return $this->challenge;
  33. }
  34. public function appId()
  35. {
  36. return $this->appId;
  37. }
  38. public function jsonSerialize()
  39. {
  40. return [
  41. 'version' => $this->version,
  42. 'challenge' => $this->challenge,
  43. 'appId' => $this->appId,
  44. ];
  45. }
  46. }