Module io.inverno.mod.security.jose
Package io.inverno.mod.security.jose.jwa
Enum Class RSAAlgorithm
- All Implemented Interfaces:
JWAAlgorithm<RSAJWK>
,Serializable
,Comparable<RSAAlgorithm>
,Constable
RSA algorithms as defined by RFC7518.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionPS256 signature algorithm as defined by RFC7518 Section 3.5.PS384 signature algorithm as defined by RFC7518 Section 3.5.PS512 signature algorithm as defined by RFC7518 Section 3.5.RS1 signature algorithm as defined by RFC8812 Section 2.RS256 signature algorithm as defined by RFC7518 Section 3.3.RS384 signature algorithm as defined by RFC7518 Section 3.3.RS512 signature algorithm as defined by RFC7518 Section 3.3.RSA-OAEP key management algorithm as defined by RFC7518 Section 4.3.RSA-OAEP-256 key management algorithm as defined by RFC7518 Section 4.3.RSA-OAEP-384 key management algorithm as defined by RFC7518 Section 4.3.RSA-OAEP-512 key management algorithm as defined by RFC7518 Section 4.3.RSA1_5 key management algorithm as defined by RFC7518 Section 4.2. -
Method Summary
Modifier and TypeMethodDescriptioncreateCipher
(RSAJWK jwk) Creates a cipher from the algorithm.createKeyManager
(RSAJWK jwk) Creates a key manager from the algorithm.createSigner
(RSAJWK jwk) Creates a signer from the algorithm.static RSAAlgorithm
fromAlgorithm
(String alg) Returns the RSA algorithm corresponding to the specified JWA registered algorithm name.Returns the JWA registered name of the algorithm.Return the JCA algorithm corresponding to the JWA algorithm.Returns the JCA signature algorithm parameters corresponding to the JWA algorithm.boolean
Determines whether the algorithm is an encryption algorithm.boolean
Determines whether the algorithm is a key management algorithm.boolean
Determines whether the algorithm is a signature algorithm.static RSAAlgorithm
Returns the enum constant of this class with the specified name.static RSAAlgorithm[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
RS1
RS1 signature algorithm as defined by RFC8812 Section 2. -
RS256
RS256 signature algorithm as defined by RFC7518 Section 3.3. -
RS384
RS384 signature algorithm as defined by RFC7518 Section 3.3. -
RS512
RS512 signature algorithm as defined by RFC7518 Section 3.3. -
PS256
PS256 signature algorithm as defined by RFC7518 Section 3.5. -
PS384
PS384 signature algorithm as defined by RFC7518 Section 3.5. -
PS512
PS512 signature algorithm as defined by RFC7518 Section 3.5. -
RSA1_5
RSA1_5 key management algorithm as defined by RFC7518 Section 4.2. -
RSA_OAEP
RSA-OAEP key management algorithm as defined by RFC7518 Section 4.3. -
RSA_OAEP_256
RSA-OAEP-256 key management algorithm as defined by RFC7518 Section 4.3. -
RSA_OAEP_384
RSA-OAEP-384 key management algorithm as defined by RFC7518 Section 4.3. -
RSA_OAEP_512
RSA-OAEP-512 key management algorithm as defined by RFC7518 Section 4.3.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
getAlgorithm
Description copied from interface:JWAAlgorithm
Returns the JWA registered name of the algorithm.
- Specified by:
getAlgorithm
in interfaceJWAAlgorithm<RSAJWK>
- Returns:
- a JWA registered name
-
isSignature
public boolean isSignature()Description copied from interface:JWAAlgorithm
Determines whether the algorithm is a signature algorithm.
- Specified by:
isSignature
in interfaceJWAAlgorithm<RSAJWK>
- Returns:
- true if the algorithm is a signature algorithm, false otherwise
-
isKeyManagement
public boolean isKeyManagement()Description copied from interface:JWAAlgorithm
Determines whether the algorithm is a key management algorithm.
- Specified by:
isKeyManagement
in interfaceJWAAlgorithm<RSAJWK>
- Returns:
- true if the algorithm is a key management algorithm, false otherwise
-
isEncryption
public boolean isEncryption()Description copied from interface:JWAAlgorithm
Determines whether the algorithm is an encryption algorithm.
- Specified by:
isEncryption
in interfaceJWAAlgorithm<RSAJWK>
- Returns:
- true if the algorithm is an encryption algorithm, false otherwise
-
createSigner
Description copied from interface:JWAAlgorithm
Creates a signer from the algorithm.
- Specified by:
createSigner
in interfaceJWAAlgorithm<RSAJWK>
- Parameters:
jwk
- the key to use for signing- Returns:
- a JWA signer
- Throws:
JWAProcessingException
- if the algorithm is not a signature algorithm or if there was an error creating the signer
-
createKeyManager
Description copied from interface:JWAAlgorithm
Creates a key manager from the algorithm.
- Specified by:
createKeyManager
in interfaceJWAAlgorithm<RSAJWK>
- Parameters:
jwk
- the key to use for signing- Returns:
- a JWA key manager
- Throws:
JWAProcessingException
- if the algorithm is not a key management algorithm or if there was an error creating the key manager
-
createCipher
Description copied from interface:JWAAlgorithm
Creates a cipher from the algorithm.
- Specified by:
createCipher
in interfaceJWAAlgorithm<RSAJWK>
- Parameters:
jwk
- the key to use for signing- Returns:
- a JWA cipher
- Throws:
JWAProcessingException
- if the algorithm is not an encryption algorithm or if there was an error creating the cipher
-
getJcaAlgorithm
Return the JCA algorithm corresponding to the JWA algorithm.
- Returns:
- a JCA algorithm name
-
getSignatureParameter
Returns the JCA signature algorithm parameters corresponding to the JWA algorithm.
Note that this only applies to signature algorithms.
- Returns:
- algorithm parameters or null
-
fromAlgorithm
Returns the RSA algorithm corresponding to the specified JWA registered algorithm name.
- Parameters:
alg
- a JWA registered algorithm name- Returns:
- a RSA algorithm
- Throws:
IllegalArgumentException
- if the specified algorithm is not a RSA algorithm.
-