@Test public void generate() { PrivateKey privateKey = PrivateKeyEd25519.fromHexString("cdf762a91a9932fe755d1e62e1eabf94111d3fe9eafc191fe9cbedbd0902252c"); PublicKey publicKey = generator2.derivePublicKey(privateKey); assertThat(publicKey.getHexString(), is("18c484505c8f175bbdd511acde1faaea8e35a579cfc0d220f6d3513ebb4204b5")); }
@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);  }