keywrap.py 735 B

12345678910111213141516171819202122232425
  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 annotations
  5. from cryptography.hazmat.bindings._rust import openssl as rust_openssl
  6. __all__ = [
  7. "InvalidUnwrap",
  8. "aes_key_unwrap",
  9. "aes_key_unwrap_with_padding",
  10. "aes_key_wrap",
  11. "aes_key_wrap_with_padding",
  12. ]
  13. class InvalidUnwrap(Exception):
  14. pass
  15. aes_key_wrap = rust_openssl.keywrap.aes_key_wrap
  16. aes_key_unwrap = rust_openssl.keywrap.aes_key_unwrap
  17. aes_key_wrap_with_padding = rust_openssl.keywrap.aes_key_wrap_with_padding
  18. aes_key_unwrap_with_padding = rust_openssl.keywrap.aes_key_unwrap_with_padding