Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# This file is dual licensed under the terms of the Apache License, Version 

2# 2.0, and the BSD License. See the LICENSE file in the root of this repository 

3# for complete details. 

4 

5import typing 

6 

7_default_backend: typing.Any = None 

8 

9 

10def default_backend(): 

11 global _default_backend 

12 

13 if _default_backend is None: 

14 from cryptography.hazmat.backends.openssl.backend import backend 

15 

16 _default_backend = backend 

17 

18 return _default_backend 

19 

20 

21def _get_backend(backend): 

22 if backend is None: 

23 return default_backend() 

24 else: 

25 return backend