Botan  1.10.9
rfc3394.h
Go to the documentation of this file.
1 /*
2 * AES Key Wrap (RFC 3394)
3 * (C) 2011 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7 
8 #ifndef BOTAN_AES_KEY_WRAP_H__
9 #define BOTAN_AES_KEY_WRAP_H__
10 
11 #include <botan/symkey.h>
12 
13 namespace Botan {
14 
15 class Algorithm_Factory;
16 
17 /**
18 * Encrypt a key under a key encryption key using the algorithm
19 * described in RFC 3394
20 *
21 * @param key the plaintext key to encrypt
22 * @param kek the key encryption key
23 * @param af an algorithm factory
24 * @return key encrypted under kek
25 */
26 SecureVector<byte> BOTAN_DLL rfc3394_keywrap(const MemoryRegion<byte>& key,
27  const SymmetricKey& kek,
28  Algorithm_Factory& af);
29 
30 /**
31 * Decrypt a key under a key encryption key using the algorithm
32 * described in RFC 3394
33 *
34 * @param key the encrypted key to decrypt
35 * @param kek the key encryption key
36 * @param af an algorithm factory
37 * @return key decrypted under kek
38 */
39 SecureVector<byte> BOTAN_DLL rfc3394_keyunwrap(const MemoryRegion<byte>& key,
40  const SymmetricKey& kek,
41  Algorithm_Factory& af);
42 
43 }
44 
45 #endif
SecureVector< byte > rfc3394_keywrap(const MemoryRegion< byte > &key, const SymmetricKey &kek, Algorithm_Factory &af)
Definition: rfc3394.cpp:35
OctetString SymmetricKey
Definition: symkey.h:147
SecureVector< byte > rfc3394_keyunwrap(const MemoryRegion< byte > &key, const SymmetricKey &kek, Algorithm_Factory &af)
Definition: rfc3394.cpp:77