Package org.apache.sshd.common.kex
Enum MontgomeryCurve
- All Implemented Interfaces:
Serializable,Comparable<MontgomeryCurve>,CurveSizeIndicator,KeySizeIndicator,OptionalFeature
public enum MontgomeryCurve
extends Enum<MontgomeryCurve>
implements KeySizeIndicator, CurveSizeIndicator, 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.
- See Also:
-
Enum Constant Summary
Enum Constants -
Field Summary
Fields inherited from interface org.apache.sshd.common.OptionalFeature
FALSE, TRUE -
Method Summary
Modifier and TypeMethodDescriptiondecode(byte[] key) byte[]intRetrieves the length of a point coordinate in bytes.intbooleanstatic MontgomeryCurveReturns 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
-
getByteLength
public int getByteLength()Description copied from interface:CurveSizeIndicatorRetrieves the length of a point coordinate in bytes.- Specified by:
getByteLengthin interfaceCurveSizeIndicator- Returns:
- the length
-
getKeySize
public int getKeySize()- Specified by:
getKeySizein interfaceKeySizeIndicator
-
isSupported
public boolean isSupported()- Specified by:
isSupportedin interfaceOptionalFeature
-
createKeyAgreement
- Throws:
GeneralSecurityException
-
generateKeyPair
-
encode
- Throws:
InvalidKeyException
-
decode
- Throws:
InvalidKeySpecException
-