Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
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
15class Config;
16class CChainParams;
17
18CKey DecodeSecret(const std::string &str);
19CKey DecodeSecret(const std::string &str, const CChainParams &params);
20std::string EncodeSecret(const CKey &key);
21std::string EncodeSecret(const CKey &key, const CChainParams &params);
22
23CExtKey DecodeExtKey(const std::string &str);
24std::string EncodeExtKey(const CExtKey &extkey);
25CExtPubKey DecodeExtPubKey(const std::string &str);
26std::string EncodeExtPubKey(const CExtPubKey &extpubkey);
27
28std::string EncodeDestination(const CTxDestination &dest, const Config &config);
29CTxDestination DecodeDestination(const std::string &addr, const CChainParams &);
30bool IsValidDestinationString(const std::string &str,
31 const CChainParams &params);
32
33std::string EncodeLegacyAddr(const CTxDestination &dest,
34 const CChainParams &params);
35CTxDestination DecodeLegacyAddr(const std::string &str,
36 const CChainParams &params);
37
38#endif // BITCOIN_KEY_IO_H
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Definition chainparams.h:80
An encapsulated secp256k1 private key.
Definition key.h:28
std::string EncodeDestination(const CTxDestination &dest, const Config &config)
Definition key_io.cpp:167
bool IsValidDestinationString(const std::string &str, const CChainParams &params)
Definition key_io.cpp:183
CExtPubKey DecodeExtPubKey(const std::string &str)
Definition key_io.cpp:118
std::string EncodeExtPubKey(const CExtPubKey &extpubkey)
Definition key_io.cpp:132
std::string EncodeSecret(const CKey &key)
Definition key_io.cpp:102
std::string EncodeExtKey(const CExtKey &extkey)
Definition key_io.cpp:156
CKey DecodeSecret(const std::string &str)
Definition key_io.cpp:77
CTxDestination DecodeDestination(const std::string &addr, const CChainParams &)
Definition key_io.cpp:174
CTxDestination DecodeLegacyAddr(const std::string &str, const CChainParams &params)
Definition key_io.cpp:193
std::string EncodeLegacyAddr(const CTxDestination &dest, const CChainParams &params)
Definition key_io.cpp:188
CExtKey DecodeExtKey(const std::string &str)
Definition key_io.cpp:142
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
std::variant< CNoDestination, PKHash, ScriptHash > CTxDestination
A txout script template with a specific destination.
Definition standard.h:85
Definition key.h:164