Botan  2.6.0
Crypto and TLS for C++11
xmss_wots_addressed_privatekey.h
Go to the documentation of this file.
1 /**
2  * XMSS WOTS Addressed Private Key
3  * (C) 2016 Matthias Gierlings
4  *
5  * Botan is released under the Simplified BSD License (see license.txt)
6  **/
7 
8 #ifndef BOTAN_XMSS_WOTS_ADDRESSED_PRIVATEKEY_H_
9 #define BOTAN_XMSS_WOTS_ADDRESSED_PRIVATEKEY_H_
10 
11 #include <botan/xmss_address.h>
12 #include <botan/internal/xmss_wots_addressed_publickey.h>
13 #include <botan/xmss_wots_privatekey.h>
14 
15 namespace Botan {
16 
17 /**
18  * Wrapper class to pair an XMSS_WOTS_PrivateKey with an XMSS Address. Since
19  * the PK_Ops::Signature interface does not allow an extra address
20  * parameter to be passed to the sign(RandomNumberGenerator&), the address
21  * needs to be stored together with the key and passed to the
22  * XMSS_WOTS_Signature_Operation() on creation.
23  **/
25  public virtual XMSS_WOTS_Addressed_PublicKey,
26  public virtual Private_Key
27  {
28  public:
31  m_priv_key(private_key) {}
32 
34  const XMSS_Address& adrs)
36  m_priv_key(private_key) {}
37 
40  m_priv_key(std::move(private_key)) {}
41 
43  XMSS_Address&& adrs)
45  std::move(adrs)),
46  m_priv_key(std::move(private_key)) {}
47 
48  const XMSS_WOTS_PrivateKey& private_key() const { return m_priv_key; }
49  XMSS_WOTS_PrivateKey& private_key() { return m_priv_key; }
50 
52  pkcs8_algorithm_identifier() const override
53  {
54  return m_priv_key.pkcs8_algorithm_identifier();
55  }
56 
58  {
59  return m_priv_key.private_key_bits();
60  }
61 
62  private:
63  XMSS_WOTS_PrivateKey m_priv_key;
64  };
65 
66 }
67 
68 #endif
XMSS_WOTS_Addressed_PrivateKey(const XMSS_WOTS_PrivateKey &private_key)
AlgorithmIdentifier pkcs8_algorithm_identifier() const override
Definition: bigint.h:719
AlgorithmIdentifier pkcs8_algorithm_identifier() const override
secure_vector< uint8_t > private_key_bits() const override
XMSS_WOTS_Addressed_PrivateKey(const XMSS_WOTS_PrivateKey &private_key, const XMSS_Address &adrs)
const XMSS_WOTS_PrivateKey & private_key() const
Definition: alg_id.cpp:13
XMSS_WOTS_Addressed_PrivateKey(XMSS_WOTS_PrivateKey &&private_key)
XMSS_WOTS_Addressed_PrivateKey(XMSS_WOTS_PrivateKey &&private_key, XMSS_Address &&adrs)
secure_vector< uint8_t > private_key_bits() const override
std::vector< T, secure_allocator< T > > secure_vector
Definition: secmem.h:88