Bitcoin ABC  0.22.13
P2P Digital Currency
key_io.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2015 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef BITCOIN_KEY_IO_H
7 #define BITCOIN_KEY_IO_H
8 
9 #include <key.h>
10 #include <pubkey.h>
11 #include <script/standard.h>
12 
13 #include <string>
14 
15 class Config;
16 class CChainParams;
17 
18 CKey DecodeSecret(const std::string &str);
19 CKey DecodeSecret(const std::string &str, const CChainParams &params);
20 std::string EncodeSecret(const CKey &key);
21 std::string EncodeSecret(const CKey &key, const CChainParams &params);
22 
23 CExtKey DecodeExtKey(const std::string &str);
24 std::string EncodeExtKey(const CExtKey &extkey);
25 CExtPubKey DecodeExtPubKey(const std::string &str);
26 std::string EncodeExtPubKey(const CExtPubKey &extpubkey);
27 
28 std::string EncodeDestination(const CTxDestination &dest, const Config &config);
29 CTxDestination DecodeDestination(const std::string &addr, const CChainParams &);
30 bool IsValidDestinationString(const std::string &str,
31  const CChainParams &params);
32 
33 std::string EncodeLegacyAddr(const CTxDestination &dest,
34  const CChainParams &params);
35 CTxDestination DecodeLegacyAddr(const std::string &str,
36  const CChainParams &params);
37 
38 #endif // BITCOIN_KEY_IO_H
bool IsValidDestinationString(const std::string &str, const CChainParams &params)
Definition: key_io.cpp:186
Definition: key.h:158
std::string EncodeDestination(const CTxDestination &dest, const Config &config)
Definition: key_io.cpp:170
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
Definition: chainparams.h:47
std::string EncodeExtKey(const CExtKey &extkey)
Definition: key_io.cpp:159
std::string EncodeSecret(const CKey &key)
Definition: key_io.cpp:105
Definition: config.h:19
CExtPubKey DecodeExtPubKey(const std::string &str)
Definition: key_io.cpp:121
CTxDestination DecodeLegacyAddr(const std::string &str, const CChainParams &params)
Definition: key_io.cpp:196
CTxDestination DecodeDestination(const std::string &addr, const CChainParams &)
Definition: key_io.cpp:177
std::string EncodeExtPubKey(const CExtPubKey &extpubkey)
Definition: key_io.cpp:135
An encapsulated secp256k1 private key.
Definition: key.h:25
CExtKey DecodeExtKey(const std::string &str)
Definition: key_io.cpp:145
std::string EncodeLegacyAddr(const CTxDestination &dest, const CChainParams &params)
Definition: key_io.cpp:191
boost::variant< CNoDestination, PKHash, ScriptHash > CTxDestination
A txout script template with a specific destination.
Definition: standard.h:87
CKey DecodeSecret(const std::string &str)
Definition: key_io.cpp:80