class EllipticalCurveEncryptor implements Encryptor {

    @Override
    public SharedKey computeSharedKey(PublicKey publicKey, PrivateKey privateKey) {
        try {
            KeyAgreement keyAgreement = KeyAgreement.getInstance("ECDH");

            java.security.PrivateKey privKey = keyFactory.generatePrivate(new PKCS8EncodedKeySpec(privateKey.getKeyBytes()));

            keyAgreement.init(privKey);

            LOGGER.info("Encode public key {}",publicKey.encodeToBase64());
            
            X509EncodedKeySpec encodedKeySpec = new X509EncodedKeySpec(publicKey.getKeyBytes());

            java.security.PublicKey pubKey = keyFactory.generatePublic(encodedKeySpec);

            keyAgreement.doPhase(pubKey, true);

            byte[] secret = keyAgreement.generateSecret();
            // for now ensure the secret is 32 bytes long (not sure if the keyAgreement secret length may vary
            MessageDigest sha3256 = new SHA3.Digest256();
            final byte[] digest = sha3256.digest(secret);
            return SharedKey.from(digest);
        } catch (InvalidKeyException | NoSuchAlgorithmException | InvalidKeySpecException e) {
            LOGGER.error("unable to generate shared secret", e);
            throw new EncryptorException("unable to generate shared secret");
        }
    }

    public  EllipticalCurveEncryptor(final String symmetricCipher, final String ellipticCurve);
    public  EllipticalCurveEncryptor(final String symmetricCipher, final String ellipticCurve, int nonceLength, int sharedKeyLength);

}