@Override
    public KeyPair generateKeyPair() {
        byte[] publicKeyBytes = new byte[OpenSSLX25519Key.X25519_KEY_SIZE_BYTES];
        byte[] privateKeyBytes = new byte[OpenSSLX25519Key.X25519_KEY_SIZE_BYTES];

        NativeCrypto.X25519_keypair(publicKeyBytes, privateKeyBytes);

        return new KeyPair(new OpenSSLX25519PublicKey(publicKeyBytes),
                new OpenSSLX25519PrivateKey(privateKeyBytes));
    }
An implementation of {@link KeyPairGenerator} for XDH keys which uses BoringSSL to perform all
the operations. This only supports X25519 keys.
common/src/main/java/org/conscrypt/OpenSSLXDHKeyPairGenerator.java