Module io.inverno.mod.security.jose
Package io.inverno.mod.security.jose.jwa
Interface WrappingJWAKeyManager
- All Superinterfaces:
JWA
,JWAKeyManager
A wrapping Key Management algorithm used to wrap a generated CEK used to encrypt a JWE payload.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A wrapped CEK composed of the wrapped key and a map of specific parameters resulting from the CEK wrapping and required by the recipient to unwrap the key. -
Method Summary
Modifier and TypeMethodDescriptionUnwraps the specified encrypted key and returned the unwrapped CEK.default WrappingJWAKeyManager.WrappedCEK
Wraps the CEK using a defaultSecureRandom
.Wraps the CEK using the specifiedSecureRandom
.Methods inherited from interface io.inverno.mod.security.jose.jwa.JWA
getProcessedParameters
-
Method Details
-
wrapCEK
default WrappingJWAKeyManager.WrappedCEK wrapCEK(JWK cek, Map<String, Object> parameters) throws JWAKeyManagerExceptionWraps the CEK using a default
SecureRandom
.- Parameters:
cek
- the Content encryption Key to encrypt.parameters
- the JOSE header custom parameters that might be required by the algorithm to wrap the CEK- Returns:
- a wrapped CEK
- Throws:
JWAKeyManagerException
- if there was an error wrapping the CEK
-
wrapCEK
WrappingJWAKeyManager.WrappedCEK wrapCEK(JWK cek, Map<String, Object> parameters, SecureRandom secureRandom) throws JWAKeyManagerExceptionWraps the CEK using the specified
SecureRandom
.- Parameters:
cek
- the Content encryption Key to encrypt.parameters
- the JOSE header custom parameters that might be required by the algorithm to wrap the CEKsecureRandom
- a secure random- Returns:
- a wrapped CEK
- Throws:
JWAKeyManagerException
- if there was an error wrapping the CEK
-
unwrapCEK
JWK unwrapCEK(byte[] encrypted_key, String enc, Map<String, Object> parameters) throws JWAKeyManagerExceptionUnwraps the specified encrypted key and returned the unwrapped CEK.
- Parameters:
encrypted_key
- a wrapped keyenc
- the content encryption algorithmparameters
- the JOSE header custom parameters that might be required by the algorithm to unwrap the CEK- Returns:
- an unwrapped CEK
- Throws:
JWAKeyManagerException
- if there was an error unwrapping the CEK
-