Package org.spongycastle.crypto.params

Examples of org.spongycastle.crypto.params.KeyParameter


        File backupFile = new File(path);
        wallet.saveToFile(backupFile);
    }

    public String exportPrivateKey(char[] utf16Password) throws WrongPasswordException {
        KeyParameter aesKey = null;
        ECKey decryptedKey = null;
        DumpedPrivateKey dumpedKey = null;

        try {
            ECKey ecKey = wallet.getKeys().get(0);
View Full Code Here


    }

    public void sendCoins(String amount, final String sendToAddressString, char[] utf16Password)
            throws WrongPasswordException, AddressFormatException, InsufficientMoneyException {

        KeyParameter aesKey = null;

        try {
            BigInteger aToSend = new BigInteger(amount);
            Address sendToAddress = new Address(networkParams, sendToAddressString);
            final Wallet.SendRequest request = Wallet.SendRequest.to(sendToAddress, aToSend);
View Full Code Here

        return request.toString();
    }

    public void sendPaymentRequest(final int sessionId, char[] utf16Password, final int callbackId)
            throws WrongPasswordException, InsufficientMoneyException, PaymentRequestException, IOException {
        KeyParameter aesKey = null;

        try {
            PaymentSession session = paymentSessions.get(sessionId);
            final Wallet.SendRequest request = session.getSendRequest();
View Full Code Here

    public boolean isWalletEncrypted() {
        return wallet.getKeys().get(0).isEncrypted();
    }

    public boolean isPasswordCorrect(char[] password) {
        KeyParameter aesKey = null;

        try {
            aesKey = aesKeyForPassword(password);
            return wallet.checkAESKey(aesKey);
        } catch (WrongPasswordException e) {
View Full Code Here

    }

    public void changeWalletPassword(char[] oldUtf16Password, char[] newUtf16Password) throws WrongPasswordException {
        // check if aes key for new password can be generated before decrypting
        KeyCrypterScrypt keyCrypter = new KeyCrypterScrypt();
        KeyParameter aesKey = deriveKeyAndWipePassword(newUtf16Password, keyCrypter);

        updateLastWalletChange(wallet);

        if (isWalletEncrypted()) {
            decryptWallet(oldUtf16Password);
View Full Code Here

            wipeAesKey(aesKey);
        }
    }

    private void decryptWallet(char[] oldUtf16Password) throws WrongPasswordException {
        KeyParameter oldAesKey = aesKeyForPassword(oldUtf16Password);

        try {
            wallet.decrypt(oldAesKey);
        } catch (KeyCrypterException e) {
            throw new WrongPasswordException(e);
View Full Code Here

        }
    }

    private void encryptWallet(char[] utf16Password, Wallet wallet) throws WrongPasswordException {
        KeyCrypterScrypt keyCrypter = new KeyCrypterScrypt();
        KeyParameter aesKey = deriveKeyAndWipePassword(utf16Password, keyCrypter);

        try {
            wallet.encrypt(keyCrypter, aesKey);
        } finally {
            wipeAesKey(aesKey);
View Full Code Here

            wipeAesKey(aesKey);
        }
    }

    public String signMessage(String message, char[] utf16Password) throws WrongPasswordException {
        KeyParameter aesKey = null;
        ECKey decryptedKey = null;

        try {
            ECKey ecKey = wallet.getKeys().get(0);
View Full Code Here

TOP

Related Classes of org.spongycastle.crypto.params.KeyParameter

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.