Package org.apache.sshd.common.kex
Enum MontgomeryCurve
- All Implemented Interfaces:
Serializable
,Comparable<MontgomeryCurve>
,java.lang.constant.Constable
,KeySizeIndicator
,OptionalFeature
public enum MontgomeryCurve
extends Enum<MontgomeryCurve>
implements KeySizeIndicator, OptionalFeature
Provides implementation details for Montgomery curves and their key exchange algorithms Curve25519/X25519 and
Curve448/X448 specified in RFC 7748 and RFC 8731. Montgomery curves provide improved security and flexibility over
Weierstrass curves used in ECDH.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
Fields inherited from interface org.apache.sshd.common.OptionalFeature
FALSE, TRUE
-
Method Summary
Modifier and TypeMethodDescriptiondecode
(byte[] key) byte[]
int
boolean
static MontgomeryCurve
Returns the enum constant of this type with the specified name.static MontgomeryCurve[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
x25519
X25519 uses Curve25519 and SHA-256 with a 32-byte key size. -
x448
X448 uses Curve448 and SHA-512 with a 56-byte key size.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getAlgorithm
-
getKeySize
public int getKeySize()- Specified by:
getKeySize
in interfaceKeySizeIndicator
-
isSupported
public boolean isSupported()- Specified by:
isSupported
in interfaceOptionalFeature
-
createKeyAgreement
- Throws:
GeneralSecurityException
-
createDigest
-
generateKeyPair
-
encode
- Throws:
InvalidKeyException
-
decode
- Throws:
InvalidKeySpecException
-