本文整理汇总了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;
}
}
示例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;