org.web3j.crypto.WalletUtils.generateFullNewWalletFile()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(303)

本文整理了Java中org.web3j.crypto.WalletUtils.generateFullNewWalletFile()方法的一些代码示例,展示了WalletUtils.generateFullNewWalletFile()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WalletUtils.generateFullNewWalletFile()方法的具体详情如下:
包路径:org.web3j.crypto.WalletUtils
类名称:WalletUtils
方法名:generateFullNewWalletFile

WalletUtils.generateFullNewWalletFile介绍

暂无

代码示例

代码示例来源:origin: web3j/web3j

public static String generateNewWalletFile(
    String password, File destinationDirectory, boolean useFullScrypt)
    throws CipherException, IOException, InvalidAlgorithmParameterException,
    NoSuchAlgorithmException, NoSuchProviderException {
  ECKeyPair ecKeyPair = Keys.createEcKeyPair();
  return generateWalletFile(password, ecKeyPair, destinationDirectory, useFullScrypt);
}

代码示例来源:origin: web3j/web3j

@Test
public void testGenerateFullNewWalletFile() throws Exception {
  String fileName = WalletUtils.generateFullNewWalletFile(PASSWORD, tempDir);
  testGeneratedNewWalletFile(fileName);
}

代码示例来源:origin: web3j/web3j

private void run() {
    String password = getPassword("Please enter a wallet file password: ");
    String destinationDir = getDestinationDir();
    File destination = createDir(destinationDir);

    try {
      String walletFileName = WalletUtils.generateFullNewWalletFile(password, destination);
      console.printf("Wallet file " + walletFileName
          + " successfully created in: " + destinationDir + "\n");
    } catch (CipherException | IOException | InvalidAlgorithmParameterException
        | NoSuchAlgorithmException | NoSuchProviderException e) {
      Console.exitError(e);
    }
  }
}

相关文章