__init__.py 616 B

1234567891011121314151617181920212223242526
  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. from __future__ import absolute_import, division, print_function
  5. _default_backend = None
  6. def default_backend():
  7. global _default_backend
  8. if _default_backend is None:
  9. from cryptography.hazmat.backends.openssl.backend import backend
  10. _default_backend = backend
  11. return _default_backend
  12. def _get_backend(backend):
  13. if backend is None:
  14. return default_backend()
  15. else:
  16. return backend