Package org.bitcoinj.crypto

Examples of org.bitcoinj.crypto.DeterministicKey


     * project file and use it here to find the right key in case the user restored from wallet seed words and thus
     * we cannot find pubkey in our hashmaps.
     */
    @Nullable
    public DeterministicKey getAuthKeyFromIndexOrPubKey(byte[] pubkey, int index) {
        DeterministicKey key = (DeterministicKey) findKeyFromPubKey(pubkey);
        if (key == null) {
            if (index == -1)
                return null;
            List<ChildNumber> path = checkNotNull(freshAuthKey().getParent()).getPath();
            key = getKeyByPath(HDUtils.append(path, new ChildNumber(index)));
            if (!Arrays.equals(key.getPubKey(), pubkey))
                return null;
        }
        return key;
    }
View Full Code Here


        return Coin.valueOf(Math.max(minPledgeAmount, Transaction.REFERENCE_DEFAULT_MIN_TX_FEE.multiply(4).value));
    }

    @Nullable
    public String signAsOwner(PledgingWallet wallet, String message, @Nullable KeyParameter aesKey) {
        DeterministicKey realKey = wallet.getAuthKeyFromIndexOrPubKey(authKey, authKeyIndex);
        if (realKey == null || (aesKey == null && realKey.isEncrypted()))
            return null;
        return realKey.signMessage(message, aesKey);
    }
View Full Code Here

TOP

Related Classes of org.bitcoinj.crypto.DeterministicKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.