本文整理了Java中org.web3j.crypto.Wallet.createStandard()
方法的一些代码示例,展示了Wallet.createStandard()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wallet.createStandard()
方法的具体详情如下:
包路径:org.web3j.crypto.Wallet
类名称:Wallet
方法名:createStandard
暂无
代码示例来源:origin: web3j/web3j
public static String generateWalletFile(
String password, ECKeyPair ecKeyPair, File destinationDirectory, boolean useFullScrypt)
throws CipherException, IOException {
WalletFile walletFile;
if (useFullScrypt) {
walletFile = Wallet.createStandard(password, ecKeyPair);
} else {
walletFile = Wallet.createLight(password, ecKeyPair);
}
String fileName = getWalletFileName(walletFile);
File destination = new File(destinationDirectory, fileName);
objectMapper.writeValue(destination, walletFile);
return fileName;
}
代码示例来源:origin: web3j/web3j
@Test
public void testEncryptDecryptStandard() throws Exception {
testEncryptDecrypt(Wallet.createStandard(SampleKeys.PASSWORD, SampleKeys.KEY_PAIR));
}
代码示例来源:origin: web3j/web3j
@Test
public void testCreateStandard() throws Exception {
testCreate(Wallet.createStandard(SampleKeys.PASSWORD, SampleKeys.KEY_PAIR));
}
代码示例来源:origin: ethjava/web3j-sample
/**
* 创建钱包
*
* @param password 密码
*/
public static void createWallet(String password) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException, CipherException, JsonProcessingException {
WalletFile walletFile;
ECKeyPair ecKeyPair = Keys.createEcKeyPair();
walletFile = Wallet.createStandard(password, ecKeyPair);
System.out.println("address " + walletFile.getAddress());
ObjectMapper objectMapper = ObjectMapperFactory.getObjectMapper();
String jsonStr = objectMapper.writeValueAsString(walletFile);
System.out.println("keystore json file " + jsonStr);
}
内容来源于网络,如有侵权,请联系作者删除!