@Test public void testCreate() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException { KeyWallet wallet = KeyWallet.create(); assertTrue(IconKeys.isValidAddress(wallet.getAddress().toString())); Wallet loadWallet = KeyWallet.load(wallet.getPrivateKey()); assertEquals(wallet.getAddress(), loadWallet.getAddress()); }
public static KeyWallet create() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException { Bytes privateKey = IconKeys.createPrivateKey(); Bytes publicKey = IconKeys.getPublicKey(privateKey); return new KeyWallet(privateKey, publicKey); }
KeyWallet implements Wallet { public static KeyWallet create() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException { Bytes privateKey = IconKeys.createPrivateKey(); Bytes publicKey = IconKeys.getPublicKey(privateKey); return new KeyWallet(privateKey, publicKey); } }
KeyWallet implements Wallet { public static KeyWallet create() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException { Bytes privateKey = IconKeys.createPrivateKey(); Bytes publicKey = IconKeys.getPublicKey(privateKey); return new KeyWallet(privateKey, publicKey); } private  KeyWallet(Bytes privateKey, Bytes publicKey); }
KeyWallet implements Wallet { public static KeyWallet create() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException { Bytes privateKey = IconKeys.createPrivateKey(); Bytes publicKey = IconKeys.getPublicKey(privateKey); return new KeyWallet(privateKey, publicKey); } private  KeyWallet(Bytes privateKey, Bytes publicKey); static KeyWallet load(Bytes privateKey); static KeyWallet create(); static KeyWallet load(String password, File file); static String store(KeyWallet wallet, String password, File destinationDirectory); @Override Address getAddress(); @Override byte[] sign(byte[] data); Bytes getPrivateKey(); Bytes getPublicKey(); }
KeyWallet implements Wallet { public static KeyWallet create() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException { Bytes privateKey = IconKeys.createPrivateKey(); Bytes publicKey = IconKeys.getPublicKey(privateKey); return new KeyWallet(privateKey, publicKey); } private  KeyWallet(Bytes privateKey, Bytes publicKey); static KeyWallet load(Bytes privateKey); static KeyWallet create(); static KeyWallet load(String password, File file); static String store(KeyWallet wallet, String password, File destinationDirectory); @Override Address getAddress(); @Override byte[] sign(byte[] data); Bytes getPrivateKey(); Bytes getPublicKey();  }