BMPString.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. * This file is part of the PHPASN1 library.
  4. *
  5. * Copyright © Friedrich Große <friedrich.grosse@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace FG\ASN1\Universal;
  11. use FG\ASN1\AbstractString;
  12. use FG\ASN1\Identifier;
  13. class BMPString extends AbstractString
  14. {
  15. /**
  16. * Creates a new ASN.1 BMP String.
  17. *
  18. * BMPString is a subtype of UniversalString that has its own
  19. * unique tag and contains only the characters in the
  20. * Basic Multilingual Plane (those corresponding to the first
  21. * 64K-2 cells, less cells whose encoding is used to address
  22. * characters outside the Basic Multilingual Plane) of ISO/IEC 10646-1.
  23. *
  24. * TODO The encodable characters of this type are not yet checked.
  25. *
  26. * @param string $string
  27. */
  28. public function __construct($string)
  29. {
  30. $this->value = $string;
  31. $this->allowAll();
  32. }
  33. public function getType()
  34. {
  35. return Identifier::BMP_STRING;
  36. }
  37. }