@Test(expected = IllegalArgumentException.class) public void failure_GeneratePublicKey_Curve25519() { KeyGenerator generator = new Edwards().getKeyGenerator(); generator.derivePublicKey(null); }
@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);  }