当前位置: 首页>>代码示例>>Java>>正文


Java ECKey.KeyIsEncryptedException方法代码示例

本文整理汇总了Java中org.bitcoinj.core.ECKey.KeyIsEncryptedException方法的典型用法代码示例。如果您正苦于以下问题:Java ECKey.KeyIsEncryptedException方法的具体用法?Java ECKey.KeyIsEncryptedException怎么用?Java ECKey.KeyIsEncryptedException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bitcoinj.core.ECKey的用法示例。


在下文中一共展示了ECKey.KeyIsEncryptedException方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: maybeDecrypt

import org.bitcoinj.core.ECKey; //导入方法依赖的package包/类
@Nullable
private ECKey maybeDecrypt(ECKey key) {
    if (key == null)
        return null;
    else if (key.isEncrypted()) {
        if (aesKey == null)
            throw new ECKey.KeyIsEncryptedException();
        return key.decrypt(aesKey);
    } else {
        return key;
    }
}
 
开发者ID:guodroid,项目名称:okwallet,代码行数:13,代码来源:DecryptingKeyBag.java

示例2: incrementPayment

import org.bitcoinj.core.ECKey; //导入方法依赖的package包/类
/**
 * Increments the total value which we pay the server. Note that the amount of money sent may not be the same as the
 * amount of money actually requested. It can be larger if the amount left over in the channel would be too small to
 * be accepted by the Bitcoin network. ValueOutOfRangeException will be thrown, however, if there's not enough money
 * left in the channel to make the payment at all. Only one payment can be in-flight at once. You have to ensure
 * you wait for the previous increase payment future to complete before incrementing the payment again.
 *
 * @param size How many satoshis to increment the payment by (note: not the new total).
 * @param info Information about this update, used to extend this protocol.
 * @throws ValueOutOfRangeException If the size is negative or would pay more than this channel's total value
 *                                  ({@link PaymentChannelClientConnection#state()}.getTotalValue())
 * @throws IllegalStateException If the channel has been closed or is not yet open
 *                               (see {@link PaymentChannelClientConnection#getChannelOpenFuture()} for the second)
 * @throws ECKey.KeyIsEncryptedException If the keys are encrypted and no AES key has been provided,
 * @return a future that completes when the server acknowledges receipt and acceptance of the payment.
 */
ListenableFuture<PaymentIncrementAck> incrementPayment(Coin size, @Nullable ByteString info,
                                                       @Nullable KeyParameter userKey)
        throws ValueOutOfRangeException, IllegalStateException, ECKey.KeyIsEncryptedException;
 
开发者ID:guodroid,项目名称:okwallet,代码行数:20,代码来源:IPaymentChannelClient.java


注:本文中的org.bitcoinj.core.ECKey.KeyIsEncryptedException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。