File: __init__.py

package info (click to toggle)
python-authlib 1.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,016 kB
  • sloc: python: 26,998; makefile: 53; sh: 14
file content (19 lines) | stat: -rw-r--r-- 520 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from ._jwe_algorithms import JWE_DRAFT_ALG_ALGORITHMS
from ._jwe_enc_cryptography import C20PEncAlgorithm

try:
    from ._jwe_enc_cryptodome import XC20PEncAlgorithm
except ImportError:
    XC20PEncAlgorithm = None


def register_jwe_draft(cls):
    for alg in JWE_DRAFT_ALG_ALGORITHMS:
        cls.register_algorithm(alg)

    cls.register_algorithm(C20PEncAlgorithm(256))  # C20P
    if XC20PEncAlgorithm is not None:
        cls.register_algorithm(XC20PEncAlgorithm(256))  # XC20P


__all__ = ["register_jwe_draft"]