Class RSAKeyPairUtil

java.lang.Object
fr.paris.lutece.util.rsa.RSAKeyPairUtil

@ApplicationScoped public class RSAKeyPairUtil extends Object
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 Details

    • RSAKeyPairUtil

      public RSAKeyPairUtil()
      CDI no-arg constructor.
  • Method Details

    • getPrivateKey

      public PrivateKey getPrivateKey()
      Returns:
      the privateKey
    • getPublicKey

      public PublicKey getPublicKey()
      Returns:
      the publicKey
    • getInstance

      @Deprecated(since="8.0", forRemoval=true) public static RSAKeyPairUtil getInstance() throws GeneralSecurityException
      Deprecated, for removal: This API element is subject to removal in a future version.
      use CDI injection instead
      Backward-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