Module refinery.units.formats.pkcs7sig
Expand source code Browse git
from __future__ import annotations
from refinery.lib.types import Param
from refinery.units import Arg, Unit
from refinery.units.formats.pe.pemeta import pemeta
from refinery.units.sinks.ppjson import ppjson
class pkcs7sig(Unit):
"""
Converts PKCS7 encoded signatures into a human-readable JSON representation. This can be used
to parse authenticode signatures appended to files that are not PE files to get the same output
that is produced by the pemeta unit.
"""
def __init__(self, tabular: Param[bool, Arg('-t', help='Print information in a table rather than as JSON')] = False):
super().__init__(tabular=tabular)
def process(self, data):
json = pemeta.parse_signature(data)
yield from ppjson(tabular=self.args.tabular)._pretty_output(json, indent=4, ensure_ascii=False)
Classes
class pkcs7sig (tabular=False)-
Converts PKCS7 encoded signatures into a human-readable JSON representation. This can be used to parse authenticode signatures appended to files that are not PE files to get the same output that is produced by the pemeta unit.
Expand source code Browse git
class pkcs7sig(Unit): """ Converts PKCS7 encoded signatures into a human-readable JSON representation. This can be used to parse authenticode signatures appended to files that are not PE files to get the same output that is produced by the pemeta unit. """ def __init__(self, tabular: Param[bool, Arg('-t', help='Print information in a table rather than as JSON')] = False): super().__init__(tabular=tabular) def process(self, data): json = pemeta.parse_signature(data) yield from ppjson(tabular=self.args.tabular)._pretty_output(json, indent=4, ensure_ascii=False)Ancestors
Subclasses
Class variables
var required_dependenciesvar optional_dependenciesvar consolevar reverse
Inherited members