Module io.inverno.mod.security.jose
Package io.inverno.mod.security.jose.jwa
Interface JWAAlgorithm<A extends JWK>
- Type Parameters:
A
- the type of key
- All Known Implementing Classes:
ECAlgorithm
,EdECAlgorithm
,NoAlgorithm
,OCTAlgorithm
,PBES2Algorithm
,RSAAlgorithm
,XECAlgorithm
public interface JWAAlgorithm<A extends JWK>
Base JWA algorithm as specified by RFC7518.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptioncreateCipher
(A jwk) Creates a cipher from the algorithm.createKeyManager
(A jwk) Creates a key manager from the algorithm.createSigner
(A jwk) Creates a signer from the algorithm.Returns the JWA registered name of the 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.
-
Method Details
-
getAlgorithm
String getAlgorithm()Returns the JWA registered name of the algorithm.
- Returns:
- a JWA registered name
-
isSignature
boolean isSignature()Determines whether the algorithm is a signature algorithm.
- Returns:
- true if the algorithm is a signature algorithm, false otherwise
-
isKeyManagement
boolean isKeyManagement()Determines whether the algorithm is a key management algorithm.
- Returns:
- true if the algorithm is a key management algorithm, false otherwise
-
isEncryption
boolean isEncryption()Determines whether the algorithm is an encryption algorithm.
- Returns:
- true if the algorithm is an encryption algorithm, false otherwise
-
createSigner
Creates a signer from the algorithm.
- 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
Creates a key manager from the algorithm.
- 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
Creates a cipher from the algorithm.
- 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
-