I'm using scapy to read PCAP files via Python, which is fairly straight forward. For example, I'll open a PCAP via:
packets = rdpcap('Sample_PCAP.pcap')
I can then ready through the file with a loop and look for specific layers or address packets indivdually.
packets[0].show()
I've also played around with the RawPcapReader function in scapy, which is another method to iterate through the PCAP.
I've searched far and wide and have not come across a good code example or tutorial that explains whether it is possible to read user plane information from PCAPs by applying encryption keys to it. In this case, the PCAPs I'm looking at do contain encrypted use plane information and I have the private RSA encryption keys to view the data in Wireshark (file extensions .pem and .key). These keys are configured to be used on the TLS layer looking for specific ports, IP addresses, and protocols.
How do I set up Scapy to make use of these keys in the same manner Wireshark does to give me access to the userplane information? Is this something Scapy supports?
Thanks for all and any help.