Search in sources :

Example 1 with KeyPair

use of io.nem.core.crypto.KeyPair in project nem2-sdk-java by nemtech.

the class AccountTest method shouldAcceptKeyPairAsConstructor.

@Test
void shouldAcceptKeyPairAsConstructor() {
    KeyPair random = KeyPair.random(new Ed25519CryptoEngine());
    Account account = new Account(random, NetworkType.MIJIN_TEST);
    assertEquals(random.getPrivateKey().toString().toUpperCase(), account.getPrivateKey());
    assertEquals(account.getAddress().getNetworkType(), NetworkType.MIJIN_TEST);
}
Also used : KeyPair(io.nem.core.crypto.KeyPair) Ed25519CryptoEngine(io.nem.core.crypto.ed25519.Ed25519CryptoEngine) Test(org.junit.jupiter.api.Test)

Aggregations

KeyPair (io.nem.core.crypto.KeyPair)1 Ed25519CryptoEngine (io.nem.core.crypto.ed25519.Ed25519CryptoEngine)1 Test (org.junit.jupiter.api.Test)1