/** * Verify the signature as static * * @param data signed data * @param signature signature * @param hashed whether hashed data or not * @return verification result */ public static boolean verify(byte[] data, byte[] signature, boolean hashed) { return verify(data, signature, hashed, null); }
/** * Wallet Constructor as loading the key file. * * @param keyPath keyPath(directory) * @param keyName keyName * @param password password * @throws IOException IOException * @throws InvalidCipherTextException InvalidCipherTextException */ public Wallet(String keyPath, String keyName, String password) throws IOException, InvalidCipherTextException { decryptKeyFileInit(keyPath, keyName, password); }
public TransactionSignature(Wallet wallet, byte[] headerHash) { this(wallet.signHashedData(headerHash)); }
@Bean Wallet wallet(DefaultConfig defaultConfig) throws IOException, InvalidCipherTextException { return new Wallet(defaultConfig); } }
public TransactionReceiptImpl(TransactionHusk tx) { this.txId = tx.getHash().toString(); this.issuer = tx.getAddress().toString(); }
@Test public void testGetAddressWithWallet() { TransactionHusk tx1 = createTransferTx(); TransactionHusk tx2 = createTransferTx(); assertThat(tx1.getAddress()).isEqualTo(tx2.getAddress()); Wallet wallet = TestConstants.wallet(); assertThat(wallet.getAddress()).isEqualTo(tx1.getAddress().getBytes()); }
@Override public String toString() { return "Wallet{" + "keyPath=" + keyPath + ", keyName=" + keyName + ", address=" + getHexAddress() + ", publicKey=" + Hex.toHexString(publicKey) + '}'; }
public static AccountDto createBy(Account account) { AccountDto dto = new AccountDto(); dto.setAddress(Hex.encodeHexString(account.getAddress())); return dto; } }
@Override public String createAccount() { try { Account account = new Account(); AccountDto response = AccountDto.createBy(account); return response.getAddress(); } catch (Exception exception) { throw new NonExistObjectException("wallet"); } }
public static Address of(String addr) { return new Address(Hex.decode(addr)); } }
public BlockSignature(Wallet wallet, byte[] headerHash) { this(wallet.signHashedData(headerHash)); }
@Before public void setUp() throws IOException, InvalidCipherTextException { wallet = new Wallet(); }
/** * Get the address. * * @return address */ public Address getAddress() { try { return new Address(this.coreTransaction.getAddress()); } catch (Exception e) { log.debug(e.getMessage()); return null; } }
/** * Transaction Constructor. * * @param header transaction header * @param wallet wallet for signing * @param body transaction body */ public Transaction(TransactionHeader header, Wallet wallet, TransactionBody body) { this(header, wallet.signHashedData(header.getHashForSigning()), body); }
@Before public void setUp() throws IOException, InvalidCipherTextException { wallet = new Wallet(); }
public Address getAddress() { try { return new Address(this.coreBlock.getAddress()); } catch (Exception e) { throw new NotValidateException(e); } }
public Block(BlockHeader header, Wallet wallet, BlockBody body) { this(header, wallet.signHashedData(header.getHashForSigning()), body); }
@Before public void setUp() throws IOException, InvalidCipherTextException { wallet = new Wallet(); }