Split buf into two strings (part1, part2) where part1 has count bytes. @raises ValueError if buf is too short.
(self, buf, count)
| 635 | return None |
| 636 | |
| 637 | def __splitBytes(self, buf, count): |
| 638 | """ |
| 639 | Split buf into two strings (part1, part2) where part1 has count bytes. |
| 640 | @raises ValueError if buf is too short. |
| 641 | """ |
| 642 | if len(buf) < count: |
| 643 | raise ValueError( |
| 644 | ( |
| 645 | "Malformed structure encountered when parsing SCT, " |
| 646 | + "expected %d bytes, got only %d" |
| 647 | ) |
| 648 | % (count, len(buf)) |
| 649 | ) |
| 650 | |
| 651 | return buf[:count], buf[count:] |
| 652 | |
| 653 | def __parse_sct(self, asn1_sctList, sct_type): |
| 654 | """ |