(self, header)
| 693 | return ensure_dict(obj, "JWE") |
| 694 | |
| 695 | def get_header_alg(self, header): |
| 696 | if "alg" not in header: |
| 697 | raise MissingAlgorithmError() |
| 698 | |
| 699 | alg = header["alg"] |
| 700 | if alg not in self.ALG_REGISTRY: |
| 701 | raise UnsupportedAlgorithmError() |
| 702 | |
| 703 | instance = self.ALG_REGISTRY[alg] |
| 704 | |
| 705 | # use all ALG_REGISTRY algorithms |
| 706 | if self._algorithms is None: |
| 707 | # do not use deprecated algorithms |
| 708 | if instance.deprecated: |
| 709 | raise UnsupportedAlgorithmError() |
| 710 | elif alg not in self._algorithms: |
| 711 | raise UnsupportedAlgorithmError() |
| 712 | return instance |
| 713 | |
| 714 | def get_header_enc(self, header): |
| 715 | if "enc" not in header: |
no test coverage detected