CatapultServer  v0.5.0.1 (Elephant)
KeyPair.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "KeyGenerator.h"
23 #include "PrivateKey.h"
24 #include "catapult/types.h"
25 
26 namespace catapult { namespace crypto {
27 
28 #ifdef SPAMMER_TOOL
29 #pragma pack(push, 16)
30 #endif
31 
33  class KeyPair final {
34  private:
35  explicit KeyPair(PrivateKey&& privateKey) : m_privateKey(std::move(privateKey)) {
37  }
38 
39  public:
42  return KeyPair(std::move(privateKey));
43  }
44 
46  static auto FromString(const std::string& privateKey) {
48  }
49 
51  const auto& privateKey() const {
52  return m_privateKey;
53  }
54 
56  const auto& publicKey() const {
57  return m_publicKey;
58  }
59 
60  private:
63  };
64 
65 #ifdef SPAMMER_TOOL
66 #pragma pack(pop)
67 #endif
68 }}
PrivateKey.h
catapult::crypto::ExtractPublicKeyFromPrivateKey
void ExtractPublicKeyFromPrivateKey(const PrivateKey &privateKey, Key &publicKey)
Extracts a public key (publicKey) from a private key ()
Definition: KeyGenerator.cpp:31
catapult::crypto::KeyPair::m_publicKey
Key m_publicKey
Definition: KeyPair.h:62
catapult::crypto::PrivateKey
Represents a private key.
Definition: PrivateKey.h:32
catapult::crypto::KeyPair::FromPrivate
static auto FromPrivate(PrivateKey &&privateKey)
Creates a key pair from privateKey.
Definition: KeyPair.h:41
catapult::crypto::KeyPair::KeyPair
KeyPair(PrivateKey &&privateKey)
Definition: KeyPair.h:35
catapult::crypto::PrivateKey::FromString
static PrivateKey FromString(const std::string &str)
Creates a private key from str.
Definition: PrivateKey.cpp:68
catapult::crypto::KeyPair
Represents a pair of private key with associated public key.
Definition: KeyPair.h:33
catapult::crypto::KeyPair::privateKey
const auto & privateKey() const
Returns a private key of a key pair.
Definition: KeyPair.h:51
catapult::crypto::KeyPair::m_privateKey
PrivateKey m_privateKey
Definition: KeyPair.h:61
catapult::crypto::KeyPair::publicKey
const auto & publicKey() const
Returns a public key of a key pair.
Definition: KeyPair.h:56
types.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::crypto::KeyPair::FromString
static auto FromString(const std::string &privateKey)
Creates a key pair from privateKey.
Definition: KeyPair.h:46
catapult::utils::ByteArray< Key_Size, Key_tag >
KeyGenerator.h