Bitcoin Core 28.99.0
P2P Digital Currency
key_io.h
Go to the documentation of this file.
1// Copyright (c) 2009-2010 Satoshi Nakamoto
2// Copyright (c) 2009-2021 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
16CKey DecodeSecret(const std::string& str);
17std::string EncodeSecret(const CKey& key);
18
19CExtKey DecodeExtKey(const std::string& str);
20std::string EncodeExtKey(const CExtKey& extkey);
21CExtPubKey DecodeExtPubKey(const std::string& str);
22std::string EncodeExtPubKey(const CExtPubKey& extpubkey);
23
24std::string EncodeDestination(const CTxDestination& dest);
25CTxDestination DecodeDestination(const std::string& str);
26CTxDestination DecodeDestination(const std::string& str, std::string& error_msg, std::vector<int>* error_locations = nullptr);
27bool IsValidDestinationString(const std::string& str);
28bool IsValidDestinationString(const std::string& str, const CChainParams& params);
29
30#endif // BITCOIN_KEY_IO_H
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
Definition: addresstype.h:140
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Definition: chainparams.h:81
An encapsulated private key.
Definition: key.h:35
bool IsValidDestinationString(const std::string &str)
Definition: key_io.cpp:316
CExtPubKey DecodeExtPubKey(const std::string &str)
Definition: key_io.cpp:244
std::string EncodeExtPubKey(const CExtPubKey &extpubkey)
Definition: key_io.cpp:257
std::string EncodeSecret(const CKey &key)
Definition: key_io.cpp:231
std::string EncodeExtKey(const CExtKey &extkey)
Definition: key_io.cpp:283
std::string EncodeDestination(const CTxDestination &dest)
Definition: key_io.cpp:294
CKey DecodeSecret(const std::string &str)
Definition: key_io.cpp:213
CTxDestination DecodeDestination(const std::string &str)
Definition: key_io.cpp:304
CExtKey DecodeExtKey(const std::string &str)
Definition: key_io.cpp:267
Definition: key.h:227