1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-25 04:17:59 +01:00

Document legacy-status of EdDSA and XDH

This commit is contained in:
Paul Schaub 2024-02-02 18:29:43 +01:00
parent 846b98e3c0
commit 8e1e90c89a
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 18 additions and 0 deletions

View file

@ -100,8 +100,18 @@ interface KeyType {
@JvmStatic fun ECDSA(curve: EllipticCurve): ECDSA = ECDSA.fromCurve(curve)
/**
* Legacy EdDSA using Ed25519.
* For OpenPGP v4 only.
*/
@JvmStatic fun EDDSA(curve: EdDSACurve): EdDSA = EdDSA.fromCurve(curve)
/**
* Legacy ECDH using Curve25519.
* For OpenPGP v4 only.
*/
@JvmStatic fun XDH(curve: XDHSpec): XDH = XDH.fromSpec(curve)
// TODO: Add crypto-refresh X25519, X448, Ed25519, Ed448
}
}

View file

@ -8,6 +8,10 @@ import org.bouncycastle.jce.spec.ECNamedCurveGenParameterSpec
import org.pgpainless.algorithm.PublicKeyAlgorithm
import org.pgpainless.key.generation.type.KeyType
/**
* Legacy EdDSA using Ed25519.
* For use with OpenPGP v4 only.
*/
class EdDSA private constructor(val curve: EdDSACurve) : KeyType {
override val name = "EdDSA"
override val algorithm = PublicKeyAlgorithm.EDDSA

View file

@ -8,6 +8,10 @@ import org.bouncycastle.jce.spec.ECNamedCurveGenParameterSpec
import org.pgpainless.algorithm.PublicKeyAlgorithm
import org.pgpainless.key.generation.type.KeyType
/**
* Legacy ECDH with Curve25519.
* For use with OpenPGP v4 only.
*/
class XDH private constructor(spec: XDHSpec) : KeyType {
override val name = "XDH"
override val algorithm = PublicKeyAlgorithm.ECDH