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 |
---|---|
Digest |
createDigest() |
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, valueOf
all, any, of
public 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 KeySizeIndicator
public boolean isSupported()
isSupported
in interface OptionalFeature
public KeyAgreement createKeyAgreement() throws GeneralSecurityException
GeneralSecurityException
public Digest createDigest()
public KeyPair generateKeyPair()
public byte[] encode(PublicKey key) throws InvalidKeyException
InvalidKeyException
public PublicKey decode(byte[] key) throws InvalidKeySpecException
InvalidKeySpecException
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.