@Test public void success_GeneratePublicKey_from_all_zero_byte32() { byte[] seed = new byte[32]; PrivateKey privateKey = PrivateKeyEd25519.fromBytes(seed); PublicKey publicKey = generator.derivePublicKey(privateKey); assertThat(publicKey.getHexString(), is("462ee976890916e54fa825d26bdd0235f5eb5b6a143c199ab0ae5ee9328e08ce")); }
@Override public PublicKey derivePublicKey(PrivateKey privateKey) { if (privateKey == null) { throw new IllegalArgumentException("PrivateKey must not be null."); } PublicKeyDelegate delegate = schemeProvider.getPublicKeyDelegate(); byte[] publicKeySeed = delegate.generatePublicKeySeed(privateKey); return new PublicKey(publicKeySeed); }
EdDsaKeyGenerator implements KeyGenerator { @Override public PublicKey derivePublicKey(PrivateKey privateKey) { if (privateKey == null) { throw new IllegalArgumentException("PrivateKey must not be null."); } PublicKeyDelegate delegate = schemeProvider.getPublicKeyDelegate(); byte[] publicKeySeed = delegate.generatePublicKeySeed(privateKey); return new PublicKey(publicKeySeed); } }
EdDsaKeyGenerator implements KeyGenerator { @Override public PublicKey derivePublicKey(PrivateKey privateKey) { if (privateKey == null) { throw new IllegalArgumentException("PrivateKey must not be null."); } PublicKeyDelegate delegate = schemeProvider.getPublicKeyDelegate(); byte[] publicKeySeed = delegate.generatePublicKeySeed(privateKey); return new PublicKey(publicKeySeed); } EdDsaKeyGenerator(SchemeProvider schemeProvider); }
EdDsaKeyGenerator implements KeyGenerator { @Override public PublicKey derivePublicKey(PrivateKey privateKey) { if (privateKey == null) { throw new IllegalArgumentException("PrivateKey must not be null."); } PublicKeyDelegate delegate = schemeProvider.getPublicKeyDelegate(); byte[] publicKeySeed = delegate.generatePublicKeySeed(privateKey); return new PublicKey(publicKeySeed); } EdDsaKeyGenerator(SchemeProvider schemeProvider); @Override EdKeyAnalyzer getKeyAnalyzer(); @Override KeyPair generateKeyPair(); @Override KeyPair generateKeyPair(PrivateKey privateKey); @Override PublicKey derivePublicKey(PrivateKey privateKey); }
EdDsaKeyGenerator implements KeyGenerator { @Override public PublicKey derivePublicKey(PrivateKey privateKey) { if (privateKey == null) { throw new IllegalArgumentException("PrivateKey must not be null."); } PublicKeyDelegate delegate = schemeProvider.getPublicKeyDelegate(); byte[] publicKeySeed = delegate.generatePublicKeySeed(privateKey); return new PublicKey(publicKeySeed); } EdDsaKeyGenerator(SchemeProvider schemeProvider); @Override EdKeyAnalyzer getKeyAnalyzer(); @Override KeyPair generateKeyPair(); @Override KeyPair generateKeyPair(PrivateKey privateKey); @Override PublicKey derivePublicKey(PrivateKey privateKey);  }