/ src / key_io.h
key_io.h
 1  // Copyright (c) 2009-2010 Satoshi Nakamoto
 2  // Copyright (c) 2009-present 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 <addresstype.h>
10  #include <chainparams.h>
11  #include <key.h>
12  #include <pubkey.h>
13  
14  #include <string>
15  
16  CKey DecodeSecret(const std::string& str);
17  std::string EncodeSecret(const CKey& key);
18  
19  CExtKey DecodeExtKey(const std::string& str);
20  std::string EncodeExtKey(const CExtKey& extkey);
21  CExtPubKey DecodeExtPubKey(const std::string& str);
22  std::string EncodeExtPubKey(const CExtPubKey& extpubkey);
23  
24  std::string EncodeDestination(const CTxDestination& dest);
25  CTxDestination DecodeDestination(const std::string& str);
26  CTxDestination DecodeDestination(const std::string& str, std::string& error_msg, std::vector<int>* error_locations = nullptr);
27  bool IsValidDestinationString(const std::string& str);
28  bool IsValidDestinationString(const std::string& str, const CChainParams& params);
29  
30  #endif // BITCOIN_KEY_IO_H