Summary
-------
Correct the PKCS8 encoded format for XDH private keys.
Problem
-------
In JDK 11, XDH (X25519/X448) private keys are encoded incorrectly. This encoding is produced by PrivateKey.getEncoded() and when an XDH private key is converted to a PKCS8EncodedKeySpec by the XDH KeyFactory. The implementation in JDK 11 also fails to decode correctly formatted keys.
Solution
--------
Modify the encoding/decoding routine so that it is correct. The incorrect encoding format from JDK 11 will no longer be supported.
Specification
-------------
No new specification. The encoding format is governed by RFC 8410.