EdDsa and Curve25519 keys

A recent extension of the OpenPGP Standard is support for keys based on Curve25519.

With version 3.2.2 OpenPGP Library for Java supports cryptography operation based on such keys and also key pairs based on Curve 25519 can be created. Here will be illustrated how to create such a keypair.

Create a key base on Curve 25519

The same method used for creating Elliptic Curve based keys is used generateEccKeyPair:

KeyStore ks = new KeyStore();
KeyPairInformation kp = ks.generateEccKeyPair(EcCurve.Curve25519, "my25519key <name@company.com>", "testpassword");

Such a key will have a master signing key based on EdDsa overCurve 25519 and an encryption subkey using Curve 25519.

Preferred symmetric cipher and hash digest

There is no need to specify preferred Compression and Hashing algorithms as the upcoming version of the OpenPGP Standard encourages using only AES-128, AES-129, AES-256 and SHA-256, SHA-384, SHA-512, which are set as defaults for keys based on EdDSA and Curve25519.