Package com.guinetik.rr.auth
Class RocketSSL
- java.lang.Object
-
- com.guinetik.rr.auth.RocketSSL
-
public class RocketSSL extends Object
Utility class for handling SSL (TLS 1.2 and 1.3) certificates and contexts. Used for setting up secure connections with custom certificates.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceRocketSSL.SSLAwareInterface for authentication strategies that can be configured with an SSL context.static classRocketSSL.SSLCertificateClass representing certificate information.static interfaceRocketSSL.SSLConfigInterface for objects that can provide certificate information.
-
Constructor Summary
Constructors Constructor Description RocketSSL()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanconfigureSsl(RocketClient client, RocketRestConfig config)Configures SSL for a client if the provided config implements SSLAware and has a custom certificate enabled.SSLContextgetSSLContext(RocketSSL.SSLCertificate SSLCertificate)Gets the SSL context for the given certificate information.SSLContextgetSSLContext(String fileName, String certPass)Gets the SSL context for the given certificate file and password.
-
-
-
Method Detail
-
getSSLContext
public SSLContext getSSLContext(RocketSSL.SSLCertificate SSLCertificate)
Gets the SSL context for the given certificate information.- Parameters:
SSLCertificate- the certificate information- Returns:
- the SSL context, or null if an error occurred
-
getSSLContext
public SSLContext getSSLContext(String fileName, String certPass)
Gets the SSL context for the given certificate file and password.- Parameters:
fileName- the certificate file pathcertPass- the certificate password- Returns:
- the SSL context, or null if an error occurred
-
configureSsl
public static boolean configureSsl(RocketClient client, RocketRestConfig config)
Configures SSL for a client if the provided config implements SSLAware and has a custom certificate enabled.- Parameters:
client- The client to configureconfig- The configuration that might contain SSL settings- Returns:
- true if SSL was successfully configured, false otherwise
-
-