Class JwkTransformerFunction
java.lang.Object
se.swedenconnect.security.credential.nimbus.JwkTransformerFunction
- All Implemented Interfaces:
Function<PkiCredential,JWK>
A function that transforms a
PkiCredential into an JWK.- Author:
- Martin Lindström
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDefault implementation of the function that returns the JOSE algorithm (algproperty).static classDefault implementation of the function that returns the key id (JWTkidproperty).static classDefault implementation of the function that returns a set ofKeyOperations for a credential.static final classDefault implementation of the function that returns theKeyUsefor a credential. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(PkiCredential credential) Transforms the suppliedPkiCredentialinto anJWK.voidsetAlgorithmFunction(Function<PkiCredential, Algorithm> algorithmFunction) Assigns the function that returns the JOSE algorithm.voidsetKeyIdFunction(Function<PkiCredential, String> keyIdFunction) Assigns the function that returns the key ID property (JWKkidproperty).voidsetKeyOpsFunction(Function<PkiCredential, Set<KeyOperation>> keyOpsFunction) Assigns the function that returns a set ofKeyOperations.voidsetKeyUseFunction(Function<PkiCredential, KeyUse> keyUseFunction) Assigns the function that returns the key use property (JWKuseproperty).withEcKeyCustomizer(Function<ECKey.Builder, ECKey.Builder> customizer) withRsaCustomizer(Function<RSAKey.Builder, RSAKey.Builder> customizer)
-
Constructor Details
-
JwkTransformerFunction
public JwkTransformerFunction()
-
-
Method Details
-
apply
Transforms the suppliedPkiCredentialinto anJWK.- Specified by:
applyin interfaceFunction<PkiCredential,JWK>
-
withRsaCustomizer
- Parameters:
customizer- to apply after default properties is set for key- Returns:
- this instance
-
withEcKeyCustomizer
- Parameters:
customizer- to apply after default properties is set for key- Returns:
- this instance
-
serializable
- Returns:
- this instance
-
setKeyIdFunction
Assigns the function that returns the key ID property (JWKkidproperty).The default implementation is
JwkTransformerFunction.DefaultKeyIdFunction.- Parameters:
keyIdFunction- the function
-
setKeyUseFunction
Assigns the function that returns the key use property (JWKuseproperty).The default implementation is
JwkTransformerFunction.DefaultKeyUseFunction.- Parameters:
keyUseFunction- the function
-
setKeyOpsFunction
Assigns the function that returns a set ofKeyOperations.The default implementation is
JwkTransformerFunction.DefaultKeyOpsFunction.- Parameters:
keyOpsFunction- the function
-
setAlgorithmFunction
Assigns the function that returns the JOSE algorithm.The default implementation is
JwkTransformerFunction.DefaultAlgorithmFunction.- Parameters:
algorithmFunction- the function
-