Class SSLHostConfigCertificate
java.lang.Object
org.apache.tomcat.util.net.SSLHostConfigCertificate
- All Implemented Interfaces:
Serializable
Represents the SSL certificate configuration for a virtual host.
Holds the certificate details for either JSSE or OpenSSL implementations.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the types of SSL certificates supported. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SSLHostConfigCertificate.TypeThe default certificate type when none is explicitly specified. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new certificate configuration with default settings.SSLHostConfigCertificate(SSLHostConfig sslHostConfig, SSLHostConfigCertificate.Type type) Creates a new certificate configuration for the given host and type. -
Method Summary
Modifier and TypeMethodDescriptionReturns the path to the certificate chain file used by OpenSSL.Returns the path to the certificate file used by OpenSSL.Returns the alias of the key entry in the keystore.Returns the path to the private key file used by OpenSSL.Returns the X509KeyManager for this certificate configuration.Returns the password for the certificate's private key.Returns the path to the file containing the certificate key password.Returns the Java KeyStore for this certificate.Returns the path to the keystore file.Returns the password used to access the keystore.Returns the path to the file containing the keystore password.Returns the provider of the keystore.Returns the type of the keystore (e.g., JKS, PKCS12).Returns the JMX ObjectName for this certificate configuration.Returns the SSLContext for this certificate.Returns the SSLContext generated from the certificate configuration.Returns the SSLHostConfig that owns this certificate configuration.getType()Returns the type of this certificate configuration.voidsetCertificateChainFile(String certificateChainFile) Sets the path to the certificate chain file used by OpenSSL.voidsetCertificateFile(String certificateFile) Sets the path to the certificate file used by OpenSSL.voidsetCertificateKeyAlias(String certificateKeyAlias) Sets the alias of the key entry in the keystore.voidsetCertificateKeyFile(String certificateKeyFile) Sets the path to the private key file used by OpenSSL.voidsetCertificateKeyManager(X509KeyManager certificateKeyManager) Sets the X509KeyManager for this certificate configuration.voidsetCertificateKeyPassword(String certificateKeyPassword) Sets the password for the certificate's private key.voidsetCertificateKeyPasswordFile(String certificateKeyPasswordFile) Sets the path to the file containing the certificate key password.voidsetCertificateKeystore(KeyStore certificateKeystore) Sets the Java KeyStore for this certificate.voidsetCertificateKeystoreFile(String certificateKeystoreFile) Sets the path to the keystore file.voidsetCertificateKeystorePassword(String certificateKeystorePassword) Sets the password used to access the keystore.voidsetCertificateKeystorePasswordFile(String certificateKeystorePasswordFile) Sets the path to the file containing the keystore password.voidsetCertificateKeystoreProvider(String certificateKeystoreProvider) Sets the provider of the keystore.voidsetCertificateKeystoreType(String certificateKeystoreType) Sets the type of the keystore (e.g., JKS, PKCS12).voidsetObjectName(ObjectName oname) Sets the JMX ObjectName for this certificate configuration.voidsetSslContext(SSLContext sslContext) Sets the provided SSLContext for this certificate configuration.
-
Field Details
-
DEFAULT_TYPE
The default certificate type when none is explicitly specified.
-
-
Constructor Details
-
SSLHostConfigCertificate
public SSLHostConfigCertificate()Creates a new certificate configuration with default settings. -
SSLHostConfigCertificate
Creates a new certificate configuration for the given host and type.- Parameters:
sslHostConfig- the parent SSL host configurationtype- the type of this certificate
-
-
Method Details
-
getSslContext
Returns the SSLContext for this certificate. Returns the provided context if set, otherwise returns the generated context.- Returns:
- the SSLContext instance
-
setSslContext
Sets the provided SSLContext for this certificate configuration.- Parameters:
sslContext- the SSLContext to use
-
getSslContextGenerated
Returns the SSLContext generated from the certificate configuration.- Returns:
- the generated SSLContext, or null if not yet generated
-
getSSLHostConfig
Returns the SSLHostConfig that owns this certificate configuration.- Returns:
- the parent SSLHostConfig
-
getObjectName
Returns the JMX ObjectName for this certificate configuration.- Returns:
- the JMX ObjectName
-
setObjectName
Sets the JMX ObjectName for this certificate configuration.- Parameters:
oname- the JMX ObjectName
-
getType
Returns the type of this certificate configuration.- Returns:
- the certificate type
-
getCertificateKeyPassword
Returns the password for the certificate's private key.- Returns:
- the certificate key password
-
setCertificateKeyPassword
Sets the password for the certificate's private key.- Parameters:
certificateKeyPassword- the certificate key password
-
getCertificateKeyPasswordFile
Returns the path to the file containing the certificate key password.- Returns:
- the key password file path
-
setCertificateKeyPasswordFile
Sets the path to the file containing the certificate key password.- Parameters:
certificateKeyPasswordFile- the key password file path
-
setCertificateKeyAlias
Sets the alias of the key entry in the keystore.- Parameters:
certificateKeyAlias- the key alias
-
getCertificateKeyAlias
Returns the alias of the key entry in the keystore.- Returns:
- the key alias
-
setCertificateKeystoreFile
Sets the path to the keystore file.- Parameters:
certificateKeystoreFile- the keystore file path
-
getCertificateKeystoreFile
Returns the path to the keystore file.- Returns:
- the keystore file path
-
setCertificateKeystorePassword
Sets the password used to access the keystore.- Parameters:
certificateKeystorePassword- the keystore password
-
getCertificateKeystorePassword
Returns the password used to access the keystore.- Returns:
- the keystore password
-
setCertificateKeystorePasswordFile
Sets the path to the file containing the keystore password.- Parameters:
certificateKeystorePasswordFile- the keystore password file path
-
getCertificateKeystorePasswordFile
Returns the path to the file containing the keystore password.- Returns:
- the keystore password file path
-
setCertificateKeystoreProvider
Sets the provider of the keystore.- Parameters:
certificateKeystoreProvider- the keystore provider name
-
getCertificateKeystoreProvider
Returns the provider of the keystore.- Returns:
- the keystore provider name
-
setCertificateKeystoreType
Sets the type of the keystore (e.g., JKS, PKCS12).- Parameters:
certificateKeystoreType- the keystore type
-
getCertificateKeystoreType
Returns the type of the keystore (e.g., JKS, PKCS12).- Returns:
- the keystore type
-
setCertificateKeystore
Sets the Java KeyStore for this certificate.- Parameters:
certificateKeystore- the KeyStore instance
-
getCertificateKeystore
Returns the Java KeyStore for this certificate. If not previously set, loads it from the configured keystore file.- Returns:
- the KeyStore instance
- Throws:
IOException- if the keystore cannot be loaded
-
setCertificateKeyManager
Sets the X509KeyManager for this certificate configuration.- Parameters:
certificateKeyManager- the X509KeyManager instance
-
getCertificateKeyManager
Returns the X509KeyManager for this certificate configuration.- Returns:
- the X509KeyManager instance
-
setCertificateChainFile
Sets the path to the certificate chain file used by OpenSSL.- Parameters:
certificateChainFile- the path to the certificate chain file
-
getCertificateChainFile
Returns the path to the certificate chain file used by OpenSSL.- Returns:
- the certificate chain file path
-
setCertificateFile
Sets the path to the certificate file used by OpenSSL.- Parameters:
certificateFile- the path to the certificate file
-
getCertificateFile
Returns the path to the certificate file used by OpenSSL.- Returns:
- the certificate file path
-
setCertificateKeyFile
Sets the path to the private key file used by OpenSSL.- Parameters:
certificateKeyFile- the path to the private key file
-
getCertificateKeyFile
Returns the path to the private key file used by OpenSSL.- Returns:
- the private key file path
-