ASN1F_STRING that encapsulates a single ASN1 packet.
| 1008 | |
| 1009 | |
| 1010 | class ASN1F_STRING_ENCAPS(ASN1F_STRING_PacketField): |
| 1011 | """ |
| 1012 | ASN1F_STRING that encapsulates a single ASN1 packet. |
| 1013 | """ |
| 1014 | |
| 1015 | def __init__(self, |
| 1016 | name, # type: str |
| 1017 | default, # type: Optional[ASN1_Packet] |
| 1018 | cls, # type: Type[ASN1_Packet] |
| 1019 | context=None, # type: Optional[Any] |
| 1020 | implicit_tag=None, # type: Optional[int] |
| 1021 | explicit_tag=None, # type: Optional[int] |
| 1022 | ): |
| 1023 | # type: (...) -> None |
| 1024 | self.cls = cls |
| 1025 | super(ASN1F_STRING_ENCAPS, self).__init__( |
| 1026 | name, |
| 1027 | default and bytes(default), # type: ignore |
| 1028 | context=context, |
| 1029 | implicit_tag=implicit_tag, |
| 1030 | explicit_tag=explicit_tag |
| 1031 | ) |
| 1032 | |
| 1033 | def m2i(self, pkt, s): # type: ignore |
| 1034 | # type: (ASN1_Packet, bytes) -> Tuple[ASN1_Packet, bytes] |
| 1035 | val = super(ASN1F_STRING_ENCAPS, self).m2i(pkt, s) |
| 1036 | return self.cls(val[0].val, _underlayer=pkt), val[1] |
no outgoing calls
no test coverage detected
searching dependent graphs…