- java.lang.Object
-
- java.lang.Enum<KeyPairGeneratorAlgorithm>
-
- io.github.astrapi69.crypto.algorithm.KeyPairGeneratorAlgorithm
-
- All Implemented Interfaces:
Algorithm
,java.io.Serializable
,java.lang.Comparable<KeyPairGeneratorAlgorithm>
public enum KeyPairGeneratorAlgorithm extends java.lang.Enum<KeyPairGeneratorAlgorithm> implements Algorithm
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DH
The shortcut value for the enum constant for DIFFIE_HELLMAN algorithm.DIFFIE_HELLMAN
The enum constant for DIFFIE_HELLMAN algorithm.DSA
The enum constant for DSA algorithm.EC
The enum constant for EC algorithm.RSA
The enum constant for RSA algorithm.RSASSA_PSS
The enum constant for RSA algorithm.UNKNOWN_TYPE
The enum constant if the algorithm type is unknown.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DH_ALGORITHM_NAME
The string constant DH_ALGORITHM_NAME for the 'DH' and is a shortcut for 'DiffieHellman' algorithmstatic java.lang.String
DIFFIE_HELLMAN_ALGORITHM_NAME
The string constant DIFFIE_HELLMAN_ALGORITHM_NAME for the 'DiffieHellman' algorithmstatic java.lang.String
DSA_ALGORITHM_NAME
The string constant DSA_ALGORITHM_NAMEstatic java.lang.String
EC_ALGORITHM_NAME
The string constant EC_ALGORITHM_NAMEstatic java.lang.String
RSA_ALGORITHM_NAME
The string constant RSA_ALGORITHM_NAMEstatic java.lang.String
RSASSA_PSS_ALGORITHM_NAME
The string constant RSAASSA_PSS_ALGORITHM_NAMEstatic java.lang.String
UNKNOWN_ALGORITHM_TYPE
The Constant UNKNOWN_ALGORITHM_TYPE is if the algorithm type is unknown.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAlgorithm()
Gets the algorithm for encryption or decryption.static KeyPairGeneratorAlgorithm
toKeyPairGeneratorAlgorithm(java.lang.String algorithm)
Transforms the given algorithm to the correspondingKeyPairGeneratorAlgorithm
objectstatic KeyPairGeneratorAlgorithm
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static KeyPairGeneratorAlgorithm[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DIFFIE_HELLMAN
public static final KeyPairGeneratorAlgorithm DIFFIE_HELLMAN
The enum constant for DIFFIE_HELLMAN algorithm.
-
DH
public static final KeyPairGeneratorAlgorithm DH
The shortcut value for the enum constant for DIFFIE_HELLMAN algorithm.
-
DSA
public static final KeyPairGeneratorAlgorithm DSA
The enum constant for DSA algorithm.
-
EC
public static final KeyPairGeneratorAlgorithm EC
The enum constant for EC algorithm.
-
RSA
public static final KeyPairGeneratorAlgorithm RSA
The enum constant for RSA algorithm.
-
RSASSA_PSS
public static final KeyPairGeneratorAlgorithm RSASSA_PSS
The enum constant for RSA algorithm.
-
UNKNOWN_TYPE
public static final KeyPairGeneratorAlgorithm UNKNOWN_TYPE
The enum constant if the algorithm type is unknown.
-
-
Field Detail
-
DIFFIE_HELLMAN_ALGORITHM_NAME
public static final java.lang.String DIFFIE_HELLMAN_ALGORITHM_NAME
The string constant DIFFIE_HELLMAN_ALGORITHM_NAME for the 'DiffieHellman' algorithm- See Also:
- Constant Field Values
-
DH_ALGORITHM_NAME
public static final java.lang.String DH_ALGORITHM_NAME
The string constant DH_ALGORITHM_NAME for the 'DH' and is a shortcut for 'DiffieHellman' algorithm- See Also:
- Constant Field Values
-
DSA_ALGORITHM_NAME
public static final java.lang.String DSA_ALGORITHM_NAME
The string constant DSA_ALGORITHM_NAME- See Also:
- Constant Field Values
-
EC_ALGORITHM_NAME
public static final java.lang.String EC_ALGORITHM_NAME
The string constant EC_ALGORITHM_NAME- See Also:
- Constant Field Values
-
RSA_ALGORITHM_NAME
public static final java.lang.String RSA_ALGORITHM_NAME
The string constant RSA_ALGORITHM_NAME- See Also:
- Constant Field Values
-
RSASSA_PSS_ALGORITHM_NAME
public static final java.lang.String RSASSA_PSS_ALGORITHM_NAME
The string constant RSAASSA_PSS_ALGORITHM_NAME- See Also:
- Constant Field Values
-
UNKNOWN_ALGORITHM_TYPE
public static final java.lang.String UNKNOWN_ALGORITHM_TYPE
The Constant UNKNOWN_ALGORITHM_TYPE is if the algorithm type is unknown.- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static KeyPairGeneratorAlgorithm[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (KeyPairGeneratorAlgorithm c : KeyPairGeneratorAlgorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static KeyPairGeneratorAlgorithm valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
toKeyPairGeneratorAlgorithm
public static KeyPairGeneratorAlgorithm toKeyPairGeneratorAlgorithm(java.lang.String algorithm)
Transforms the given algorithm to the correspondingKeyPairGeneratorAlgorithm
object- Parameters:
algorithm
- the algorithm- Returns:
- the
KeyPairGeneratorAlgorithm
object or null if not found
-
getAlgorithm
public java.lang.String getAlgorithm()
Description copied from interface:Algorithm
Gets the algorithm for encryption or decryption.- Specified by:
getAlgorithm
in interfaceAlgorithm
- Returns:
- the algorithm
-
-