| 51 | return (encodedTag | 0x1F,) + substrate |
| 52 | |
| 53 | def encodeLength(self, length, defMode): |
| 54 | if not defMode and self.supportIndefLenMode: |
| 55 | return (0x80,) |
| 56 | |
| 57 | if length < 0x80: |
| 58 | return length, |
| 59 | |
| 60 | else: |
| 61 | substrate = () |
| 62 | while length: |
| 63 | substrate = (length & 0xff,) + substrate |
| 64 | length >>= 8 |
| 65 | |
| 66 | substrateLen = len(substrate) |
| 67 | |
| 68 | if substrateLen > 126: |
| 69 | raise error.PyAsn1Error('Length octets overflow (%d)' % substrateLen) |
| 70 | |
| 71 | return (0x80 | substrateLen,) + substrate |
| 72 | |
| 73 | def encodeValue(self, value, asn1Spec, encodeFun, **options): |
| 74 | raise error.PyAsn1Error('Not implemented') |