identt
Ed25519.hpp
Go to the documentation of this file.
1 
33 #ifndef _IDENTT_CRYPTO_ED25519_HPP_
34 #define _IDENTT_CRYPTO_ED25519_HPP_
35 
36 #include <crypto/CryptoBase.hpp>
37 
38 namespace identt {
39 namespace crypto {
40 class Ed25519 : virtual public CryptoBase {
41 public:
42 
49  const static std::string GetAlgo();
50 
55  Ed25519();
56 
64  explicit Ed25519(const std::string& seed);
65 
76  explicit Ed25519(const std::string& pubkey_, const std::string& seckey_);
77 
88  explicit Ed25519( unsigned int scope_, const std::string& onekey_);
89 
90 
91  Ed25519(const Ed25519&) = delete;
92  Ed25519& operator=(const Ed25519&) = delete;
93 
94 
101  virtual std::string GetSeed() const override;
102 
112  virtual std::string GetSignature(const std::string& input) const override;
113 
126  virtual bool VerifySignature(const std::string& signature, const std::string& input) const override;
127 
140  virtual bool Encode(const std::string& input, std::string& output) const override;
141 
154  virtual bool Decode(const std::string& input, std::string& output) const override;
155 
156 protected:
157 
158 };
159 } // namespace crypto
160 } // namespace identt
161 #endif /* _IDENTT_CRYPTO_ED25519_HPP_ */
virtual bool Encode(const std::string &input, std::string &output) const override
Encode : return encoded.
Definition: Ed25519.cc:182
virtual bool Decode(const std::string &input, std::string &output) const override
Decode : return decoded.
Definition: Ed25519.cc:191
Definition: CryptoBase.hpp:51
Definition: Ed25519.hpp:40
static const std::string GetAlgo()
GetAlgo : get key algo.
Definition: Ed25519.cc:43
virtual bool VerifySignature(const std::string &signature, const std::string &input) const override
VerifySignature : return signature valid status.
Definition: Ed25519.cc:165
Definition: CryptoBase.hpp:49
virtual std::string GetSeed() const override
GetSeed : return seed of private key.
Definition: Ed25519.cc:129
Ed25519()
Ed25519 : constructor.
Definition: Ed25519.cc:52
virtual std::string GetSignature(const std::string &input) const override
GetSignature : return signature.
Definition: Ed25519.cc:146