diff --git a/src/python/jw/pkg/lib/ProcFilterGpg.py b/src/python/jw/pkg/lib/ProcFilterGpg.py new file mode 100644 index 00000000..813c1fef --- /dev/null +++ b/src/python/jw/pkg/lib/ProcFilterGpg.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +from __future__ import annotations +from typing import TYPE_CHECKING + +from .ProcFilter import ProcFilter +from .base import Result + +if TYPE_CHECKING: + from .ExecContext import ExecContext + +class ProcFilterGpg(ProcFilter): + + def __init__(self, ec: ExecContext) -> None: + self.__ec = ec + + async def _run(self, data: bytes) -> Result: + return await self.__ec.run([ + "gpg", + '--batch', + '--yes', + '--quiet', + '--no-tty', + '--decrypt', + ], + cmd_input = data, + throw = True + )