public enum MontgomeryCurve extends Enum<MontgomeryCurve> implements KeySizeIndicator, OptionalFeature
| Enum Constant and Description |
|---|
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.
|
FALSE, TRUE| Modifier and Type | Method and Description |
|---|---|
KeyAgreement |
createKeyAgreement() |
PublicKey |
decode(byte[] key) |
byte[] |
encode(PublicKey key) |
KeyPair |
generateKeyPair() |
String |
getAlgorithm() |
int |
getKeySize() |
boolean |
isSupported() |
static MontgomeryCurve |
valueOf(String name)
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.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfall, any, ofpublic static final MontgomeryCurve x25519
public static final MontgomeryCurve x448
public static MontgomeryCurve[] values()
for (MontgomeryCurve c : MontgomeryCurve.values()) System.out.println(c);
public static MontgomeryCurve valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String getAlgorithm()
public int getKeySize()
getKeySize in interface KeySizeIndicatorpublic boolean isSupported()
isSupported in interface OptionalFeaturepublic KeyAgreement createKeyAgreement() throws GeneralSecurityException
GeneralSecurityExceptionpublic KeyPair generateKeyPair()
public byte[] encode(PublicKey key) throws InvalidKeyException
InvalidKeyExceptionpublic PublicKey decode(byte[] key) throws InvalidKeySpecException
InvalidKeySpecExceptionCopyright © 2008–2024 The Apache Software Foundation. All rights reserved.