Botan  2.6.0
Crypto and TLS for C++11
xmss_key_pair.h
Go to the documentation of this file.
1 /*
2  * XMSS Key Pair
3  * (C) 2016 Matthias Gierlings
4  *
5  * Botan is released under the Simplified BSD License (see license.txt)
6  **/
7 
8 #ifndef BOTAN_XMSS_KEY_PAIR_H_
9 #define BOTAN_XMSS_KEY_PAIR_H_
10 
11 #include <botan/botan.h>
12 #include <botan/xmss_parameters.h>
13 #include <botan/xmss_wots_parameters.h>
14 #include <botan/xmss_publickey.h>
15 #include <botan/xmss_privatekey.h>
16 
17 namespace Botan {
18 
19 /**
20  * A pair of XMSS public and private key.
21  **/
23  {
24  public:
27  : m_priv_key(xmss_oid, rng), m_pub_key(m_priv_key) {}
28 
29  XMSS_Key_Pair(const XMSS_PublicKey& pub_key,
30  const XMSS_PrivateKey& priv_key)
31  : m_priv_key(priv_key), m_pub_key(pub_key)
32  {}
33 
35  XMSS_PrivateKey&& priv_key)
36  : m_priv_key(std::move(priv_key)), m_pub_key(std::move(pub_key)) {}
37 
38  const XMSS_PublicKey& public_key() const { return m_pub_key; }
39  XMSS_PublicKey& public_key() { return m_pub_key; }
40 
41  const XMSS_PrivateKey& private_key() const { return m_priv_key; }
42  XMSS_PrivateKey& private_key() { return m_priv_key; }
43 
44  private:
45  XMSS_PrivateKey m_priv_key;
46  XMSS_PublicKey m_pub_key;
47  };
48 
49 }
50 
51 #endif
XMSS_Key_Pair(XMSS_PublicKey &&pub_key, XMSS_PrivateKey &&priv_key)
Definition: xmss_key_pair.h:34
const XMSS_PrivateKey & private_key() const
Definition: xmss_key_pair.h:41
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:27
Definition: bigint.h:719
XMSS_PublicKey & public_key()
Definition: xmss_key_pair.h:39
const XMSS_PublicKey & public_key() const
Definition: xmss_key_pair.h:38
XMSS_Key_Pair(XMSS_Parameters::xmss_algorithm_t xmss_oid, RandomNumberGenerator &rng)
Definition: xmss_key_pair.h:25
Definition: alg_id.cpp:13
XMSS_Key_Pair(const XMSS_PublicKey &pub_key, const XMSS_PrivateKey &priv_key)
Definition: xmss_key_pair.h:29
XMSS_PrivateKey & private_key()
Definition: xmss_key_pair.h:42