Botan 1.10.17
pbkdf2.h
Go to the documentation of this file.
1/*
2* PBKDF2
3* (C) 1999-2007 Jack Lloyd
4*
5* Distributed under the terms of the Botan license
6*/
7
8#ifndef BOTAN_PBKDF2_H__
9#define BOTAN_PBKDF2_H__
10
11#include <botan/pbkdf.h>
12#include <botan/mac.h>
13
14namespace Botan {
15
16/**
17* PKCS #5 PBKDF2
18*/
19class BOTAN_DLL PKCS5_PBKDF2 : public PBKDF
20 {
21 public:
22 std::string name() const
23 {
24 return "PBKDF2(" + mac->name() + ")";
25 }
26
27 PBKDF* clone() const
28 {
29 return new PKCS5_PBKDF2(mac->clone());
30 }
31
32 OctetString derive_key(size_t output_len,
33 const std::string& passphrase,
34 const byte salt[], size_t salt_len,
35 size_t iterations) const;
36
37 /**
38 * Create a PKCS #5 instance using the specified message auth code
39 * @param mac_fn the MAC to use
40 */
41 PKCS5_PBKDF2(MessageAuthenticationCode* mac_fn) : mac(mac_fn) {}
42
43 /**
44 * Destructor
45 */
46 ~PKCS5_PBKDF2() { delete mac; }
47 private:
49 };
50
51}
52
53#endif
std::string name() const
Definition pbkdf2.h:22
PKCS5_PBKDF2(MessageAuthenticationCode *mac_fn)
Definition pbkdf2.h:41
PBKDF * clone() const
Definition pbkdf2.h:27