MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / EncodeSecret

Function EncodeSecret

src/key_io.cpp:232–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232std::string EncodeSecret(const CKey& key)
233{
234 assert(key.IsValid());
235 std::vector<unsigned char> data = Params().Base58Prefix(CChainParams::SECRET_KEY);
236 data.insert(data.end(), UCharCast(key.begin()), UCharCast(key.end()));
237 if (key.IsCompressed()) {
238 data.push_back(1);
239 }
240 std::string ret = EncodeBase58Check(data);
241 memory_cleanse(data.data(), data.size());
242 return ret;
243}
244
245CExtPubKey DecodeExtPubKey(const std::string& str)
246{

Callers 14

BOOST_AUTO_TEST_CASEFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
AddKeyFunction · 0.85
BOOST_FIXTURE_TEST_CASEFunction · 0.85
CreateSyncedWalletFunction · 0.85
ToPrivateStringMethod · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
key_io.cppFile · 0.85
key.cppFile · 0.85
ConsumeScalarRPCArgumentFunction · 0.85
InitMethod · 0.85
SetupDescriptorsWalletFunction · 0.85

Calls 12

UCharCastFunction · 0.85
EncodeBase58CheckFunction · 0.85
memory_cleanseFunction · 0.85
ParamsClass · 0.70
IsValidMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
IsCompressedMethod · 0.45
push_backMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by 9

BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
AddKeyFunction · 0.68
BOOST_FIXTURE_TEST_CASEFunction · 0.68
CreateSyncedWalletFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
ConsumeScalarRPCArgumentFunction · 0.68
InitMethod · 0.68
SetupDescriptorsWalletFunction · 0.68