Botan  1.11.15
src/lib/misc/rfc3394/rfc3394.h
Go to the documentation of this file.
00001 /*
00002 * AES Key Wrap (RFC 3394)
00003 * (C) 2011 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_AES_KEY_WRAP_H__
00009 #define BOTAN_AES_KEY_WRAP_H__
00010 
00011 #include <botan/symkey.h>
00012 
00013 namespace Botan {
00014 
00015 /**
00016 * Encrypt a key under a key encryption key using the algorithm
00017 * described in RFC 3394
00018 *
00019 * @param key the plaintext key to encrypt
00020 * @param kek the key encryption key
00021 * @return key encrypted under kek
00022 */
00023 secure_vector<byte> BOTAN_DLL rfc3394_keywrap(const secure_vector<byte>& key,
00024                                               const SymmetricKey& kek);
00025 
00026 /**
00027 * Decrypt a key under a key encryption key using the algorithm
00028 * described in RFC 3394
00029 *
00030 * @param key the encrypted key to decrypt
00031 * @param kek the key encryption key
00032 * @param af an algorithm factory
00033 * @return key decrypted under kek
00034 */
00035 secure_vector<byte> BOTAN_DLL rfc3394_keyunwrap(const secure_vector<byte>& key,
00036                                                 const SymmetricKey& kek);
00037 
00038 }
00039 
00040 #endif