Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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 **/
24 class XMSS_WOTS_Addressed_PrivateKey
25 : public virtual XMSS_WOTS_Addressed_PublicKey,
26 public virtual Private_Key
27 {
28 public:
29 XMSS_WOTS_Addressed_PrivateKey(const XMSS_WOTS_PrivateKey& private_key)
30 : XMSS_WOTS_Addressed_PublicKey(private_key),
31 m_priv_key(private_key) {}
32
33 XMSS_WOTS_Addressed_PrivateKey(const XMSS_WOTS_PrivateKey& private_key,
34 const XMSS_Address& adrs)
35 : XMSS_WOTS_Addressed_PublicKey(private_key, adrs),
36 m_priv_key(private_key) {}
37
38 XMSS_WOTS_Addressed_PrivateKey(XMSS_WOTS_PrivateKey&& private_key)
39 : XMSS_WOTS_Addressed_PublicKey(XMSS_WOTS_PublicKey(private_key)),
40 m_priv_key(std::move(private_key)) {}
41
42 XMSS_WOTS_Addressed_PrivateKey(XMSS_WOTS_PrivateKey&& private_key,
43 XMSS_Address&& adrs)
44 : XMSS_WOTS_Addressed_PublicKey(XMSS_WOTS_PublicKey(private_key),
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
51 virtual AlgorithmIdentifier
52 pkcs8_algorithm_identifier() const override
53 {
54 return m_priv_key.pkcs8_algorithm_identifier();
55 }
56
57 virtual secure_vector<uint8_t> private_key_bits() const override
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
Botan::XMSS_WOTS_Addressed_PrivateKey
Definition: xmss_wots_addressed_privatekey.h:24
Botan::XMSS_WOTS_Addressed_PrivateKey::private_key
XMSS_WOTS_PrivateKey & private_key()
Definition: xmss_wots_addressed_privatekey.h:49
Botan::XMSS_WOTS_Addressed_PrivateKey::private_key
const XMSS_WOTS_PrivateKey & private_key() const
Definition: xmss_wots_addressed_privatekey.h:48
Botan::Private_Key
Definition: pk_keys.h:166
Botan::XMSS_WOTS_Addressed_PrivateKey::XMSS_WOTS_Addressed_PrivateKey
XMSS_WOTS_Addressed_PrivateKey(const XMSS_WOTS_PrivateKey &private_key)
Definition: xmss_wots_addressed_privatekey.h:29
Botan::XMSS_WOTS_PrivateKey
Definition: xmss_wots_privatekey.h:27
Botan::XMSS_Address
Definition: xmss_address.h:23
std
Definition: bigint.h:619
Botan::XMSS_WOTS_PrivateKey::pkcs8_algorithm_identifier
virtual AlgorithmIdentifier pkcs8_algorithm_identifier() const override
Definition: xmss_wots_privatekey.h:219
Botan::XMSS_WOTS_Addressed_PrivateKey::XMSS_WOTS_Addressed_PrivateKey
XMSS_WOTS_Addressed_PrivateKey(const XMSS_WOTS_PrivateKey &private_key, const XMSS_Address &adrs)
Definition: xmss_wots_addressed_privatekey.h:33
Botan::XMSS_WOTS_Addressed_PublicKey
Definition: xmss_wots_addressed_publickey.h:24
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:121
Botan::XMSS_WOTS_Addressed_PrivateKey::private_key_bits
virtual secure_vector< uint8_t > private_key_bits() const override
Definition: xmss_wots_addressed_privatekey.h:57
Botan
Definition: alg_id.cpp:13
Botan::XMSS_WOTS_Addressed_PrivateKey::XMSS_WOTS_Addressed_PrivateKey
XMSS_WOTS_Addressed_PrivateKey(XMSS_WOTS_PrivateKey &&private_key)
Definition: xmss_wots_addressed_privatekey.h:38
Botan::XMSS_WOTS_PublicKey
Definition: xmss_wots_publickey.h:32
Botan::XMSS_WOTS_Addressed_PrivateKey::XMSS_WOTS_Addressed_PrivateKey
XMSS_WOTS_Addressed_PrivateKey(XMSS_WOTS_PrivateKey &&private_key, XMSS_Address &&adrs)
Definition: xmss_wots_addressed_privatekey.h:42
Botan::AlgorithmIdentifier
Definition: alg_id.h:20
Botan::XMSS_WOTS_Addressed_PrivateKey::pkcs8_algorithm_identifier
virtual AlgorithmIdentifier pkcs8_algorithm_identifier() const override
Definition: xmss_wots_addressed_privatekey.h:52
Botan::XMSS_WOTS_PrivateKey::private_key_bits
virtual secure_vector< uint8_t > private_key_bits() const override
Definition: xmss_wots_privatekey.h:229