Package fr.paris.lutece.util.rsa
Class RSAKeyPairUtil
java.lang.Object
fr.paris.lutece.util.rsa.RSAKeyPairUtil
Application-scoped holder for the RSA key pair used across the portal.
Managed as a CDI ApplicationScoped bean so that initialization is
thread-safe (guaranteed by the container) and the keys are resolved via an
IRSAKeyProvider that can be swapped with a CDI @Alternative
(e.g. RSAKeyEnvironmentProvider).
In a multi-instance deployment, all instances resolve the same keys provided
that the selected IRSAKeyProvider is cluster-aware (shared datastore
or identical environment variables).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RSAKeyPairUtilDeprecated, for removal: This API element is subject to removal in a future version.use CDI injection instead
-
Constructor Details
-
RSAKeyPairUtil
public RSAKeyPairUtil()CDI no-arg constructor.
-
-
Method Details
-
getPrivateKey
- Returns:
- the privateKey
-
getPublicKey
- Returns:
- the publicKey
-
getInstance
@Deprecated(since="8.0", forRemoval=true) public static RSAKeyPairUtil getInstance() throws GeneralSecurityExceptionDeprecated, for removal: This API element is subject to removal in a future version.use CDI injection insteadBackward-compatible accessor for legacy static callers.New code must use CDI injection (e.g.
@Inject RSAKeyPairUtil). This method will be removed in a future version.- Returns:
- the CDI-managed instance
- Throws:
GeneralSecurityException- kept on the signature for backward compatibility; never thrown by this implementation
-