public enum MontgomeryCurve extends java.lang.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.
|
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
algorithm |
private DigestFactory |
digestFactory |
private byte[] |
encodedPublicKeyPrefix |
private java.security.KeyFactory |
keyFactory |
private java.security.KeyPairGenerator |
keyPairGenerator |
private int |
keySize |
private boolean |
supported |
FALSE, TRUE| Modifier and Type | Method and Description |
|---|---|
Digest |
createDigest() |
javax.crypto.KeyAgreement |
createKeyAgreement() |
java.security.PublicKey |
decode(byte[] key) |
byte[] |
encode(java.security.PublicKey key) |
java.security.KeyPair |
generateKeyPair() |
java.lang.String |
getAlgorithm() |
int |
getKeySize() |
boolean |
isSupported() |
static MontgomeryCurve |
valueOf(java.lang.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
private final java.lang.String algorithm
private final int keySize
private final boolean supported
private final DigestFactory digestFactory
private final java.security.KeyPairGenerator keyPairGenerator
private final java.security.KeyFactory keyFactory
private final byte[] encodedPublicKeyPrefix
public static MontgomeryCurve[] values()
for (MontgomeryCurve c : MontgomeryCurve.values()) System.out.println(c);
public static MontgomeryCurve valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic java.lang.String getAlgorithm()
public int getKeySize()
getKeySize in interface KeySizeIndicatorpublic boolean isSupported()
isSupported in interface OptionalFeaturepublic javax.crypto.KeyAgreement createKeyAgreement()
throws java.security.GeneralSecurityException
java.security.GeneralSecurityExceptionpublic Digest createDigest()
public java.security.KeyPair generateKeyPair()
public byte[] encode(java.security.PublicKey key)
throws java.security.InvalidKeyException
java.security.InvalidKeyExceptionpublic java.security.PublicKey decode(byte[] key)
throws java.security.spec.InvalidKeySpecException
java.security.spec.InvalidKeySpecException