Parsable.php 1017 B

1234567891011121314151617181920212223242526272829303132
  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;
  11. use FG\ASN1\Exception\ParserException;
  12. /**
  13. * The Parsable interface describes classes that can be parsed from their binary DER representation.
  14. */
  15. interface Parsable
  16. {
  17. /**
  18. * Parse an instance of this class from its binary DER encoded representation.
  19. *
  20. * @param string $binaryData
  21. * @param int $offsetIndex the offset at which parsing of the $binaryData is started. This parameter ill be modified
  22. * to contain the offset index of the next object after this object has been parsed
  23. *
  24. * @throws ParserException if the given binary data is either invalid or not currently supported
  25. *
  26. * @return static
  27. */
  28. public static function fromBinary(&$binaryData, &$offsetIndex = null);
  29. }