aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives/keywrap.rst
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-03-16 20:57:09 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-10-21 22:40:19 -0500
commitca8e1615068efba728c2e8faf16f04ed0d1f6e29 (patch)
tree2c0a4bd1c28e5daf87f1ecc2b6ef6ca3725029b7 /docs/hazmat/primitives/keywrap.rst
parent2d79836e9dbafd217f2febb61b964157600dc9f5 (diff)
downloadcryptography-ca8e1615068efba728c2e8faf16f04ed0d1f6e29.tar.gz
cryptography-ca8e1615068efba728c2e8faf16f04ed0d1f6e29.tar.bz2
cryptography-ca8e1615068efba728c2e8faf16f04ed0d1f6e29.zip
AES keywrap support
Diffstat (limited to 'docs/hazmat/primitives/keywrap.rst')
-rw-r--r--docs/hazmat/primitives/keywrap.rst43
1 files changed, 43 insertions, 0 deletions
diff --git a/docs/hazmat/primitives/keywrap.rst b/docs/hazmat/primitives/keywrap.rst
new file mode 100644
index 00000000..2ef6b798
--- /dev/null
+++ b/docs/hazmat/primitives/keywrap.rst
@@ -0,0 +1,43 @@
+.. hazmat::
+
+.. module:: cryptography.hazmat.primitives.keywrap
+
+Key wrapping
+============
+
+Key wrapping is a cryptographic construct that uses symmetric encryption to
+encapsulate key material.
+
+.. function:: aes_key_wrap(wrapping_key, key_to_wrap, backend)
+
+ :param bytes wrapping_key: The wrapping key.
+
+ :param bytes key_to_wrap: The key to wrap.
+
+ :param backend: A
+ :class:`~cryptography.hazmat.backends.interfaces.CipherBackend`
+ provider that supports
+ :class:`~cryptography.hazmat.primitives.ciphers.algorithms.AES`.
+
+ :return bytes: The wrapped key as bytes.
+
+.. function:: aes_key_unwrap(wrapping_key, wrapped_key, backend)
+
+ :param bytes wrapping_key: The wrapping key.
+
+ :param bytes wrapped_key: The wrapped key.
+
+ :param backend: A
+ :class:`~cryptography.hazmat.backends.interfaces.CipherBackend`
+ provider that supports
+ :class:`~cryptography.hazmat.primitives.ciphers.algorithms.AES`.
+
+ :return bytes: The unwrapped key as bytes.
+
+Exceptions
+~~~~~~~~~~
+
+.. class:: InvalidUnwrap
+
+ This is raised when a wrapped key fails to unwrap. It can be caused by a
+ corrupted or invalid wrapped key or an invalid wrapping key.