Пример #1
0
bool RippleAddress::setSeedGeneric (const std::string& strText)
{
    RippleAddress   naTemp;
    bool            bResult = true;
	uint256         uSeed;

    if (strText.empty ()
            || naTemp.setAccountID (strText)
            || naTemp.setAccountPublic (strText)
            || naTemp.setAccountPrivate (strText)
            || naTemp.setNodePublic (strText)
            || naTemp.setNodePrivate (strText))
    {
        bResult = false;
    }
    else if (strText.length () == 32 && uSeed.SetHex (strText, true))
    {
        setSeed (uSeed);
    }
    else if (setSeed (strText))
    {
        // Log::out() << "Recognized seed.";
        nothing ();
    }
    else
    {
        // Log::out() << "Creating seed from pass phrase.";
        setSeed (EdKeyPair::passPhraseToKey (strText));
    }

    return bResult;
}
Пример #2
0
RippleAddress RippleAddress::createAccountPrivate(const RippleAddress& naGenerator, const RippleAddress& naSeed, int iSeq)
{
	RippleAddress	naNew;

	naNew.setAccountPrivate(naGenerator, naSeed, iSeq);

	return naNew;
}
Пример #3
0
RippleAddress RippleAddress::createAccountPrivate (const RippleAddress& naSeed)
{
    RippleAddress   naNew;
	EdKeyPair pair(naSeed.getSeed());

    naNew.setAccountPrivate (pair.mPrivateKey);

    return naNew;
}
Пример #4
0
RippleAddress RippleAddress::createAccountPrivate (
    RippleAddress const& generator, RippleAddress const& naSeed, int iSeq)
{
    RippleAddress   naNew;

    naNew.setAccountPrivate (generator, naSeed, iSeq);

    return naNew;
}
Пример #5
0
bool RippleAddress::setSeedGeneric(const std::string& strText)
{
	RippleAddress	naTemp;
	bool			bResult	= true;
	uint128			uSeed;

	if (strText.empty()
		|| naTemp.setAccountID(strText)
		|| naTemp.setAccountPublic(strText)
		|| naTemp.setAccountPrivate(strText)
		|| naTemp.setNodePublic(strText)
		|| naTemp.setNodePrivate(strText))
	{
		bResult	= false;
	}
	else if (strText.length() == 32 && uSeed.SetHex(strText, true))
	{
		setSeed(uSeed);
	}
	else if (setSeed(strText))
	{
		// std::cerr << "Recognized seed." << std::endl;
		nothing();
	}
	else if (1 == setSeed1751(strText))
	{
		// std::cerr << "Recognized 1751 seed." << std::endl;
		nothing();
	}
	else
	{
		// std::cerr << "Creating seed from pass phrase." << std::endl;
		setSeed(CKey::PassPhraseToKey(strText));
	}

	return bResult;
}
Пример #6
0
bool RippleAddress::setSeedGeneric (std::string const& strText)
{
    RippleAddress   naTemp;
    bool            bResult = true;
    uint128         uSeed;

    if (parseBase58<AccountID>(strText))
        return false;

    if (strText.empty ()
            || naTemp.setAccountPublic (strText)
            || naTemp.setAccountPrivate (strText)
            || naTemp.setNodePublic (strText)
            || naTemp.setNodePrivate (strText))
    {
        bResult = false;
    }
    else if (strText.length () == 32 && uSeed.SetHex (strText, true))
    {
        setSeed (uSeed);
    }
    else if (setSeed (strText))
    {
        // Log::out() << "Recognized seed.";
    }
    else if (1 == setSeed1751 (strText))
    {
        // Log::out() << "Recognized 1751 seed.";
    }
    else
    {
        setSeed (PassPhraseToKey (strText));
    }

    return bResult;
}