java.lang.Object
io.javalin.community.ssl.TrustConfig
Configuration for the trust store, used to verify the identity of the clients.
Using this configuration, the server will only accept connections from clients that are trusted.
If no trust store is configured, the server will accept any client.
-
Field Summary
FieldsModifier and TypeFieldDescriptionList of certificates to be trusted, can be loaded using the helper methods or directly.List of KeyStores to be trusted, can be loaded using the helper methods or directly. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcertificateFromClasspath(String certificateFile) Load certificate data from the classpath.voidcertificateFromInputStream(InputStream certificateInputStream) Load certificate data from a given input stream.voidcertificateFromPath(String certificatePath) Load certificate data from a given path in the system.voidp7bCertificateFromString(String certificateString) Load P7B certificate data from a given string.voidpemFromString(String certificateString) Load pem formatted identity data from a given string.voidtrustStoreFromClasspath(String trustStoreFile, String trustStorePassword) Load a trust store from the classpath.voidtrustStoreFromInputStream(InputStream trustStoreInputStream, String trustStorePassword) Load a trust store from a given input stream.voidtrustStoreFromPath(String trustStorePath, String trustStorePassword) Load a trust store from a given path in the system.
-
Field Details
-
certificates
List of certificates to be trusted, can be loaded using the helper methods or directly. This list is complementary to the keys -
keyStores
List of KeyStores to be trusted, can be loaded using the helper methods or directly.
-
-
Constructor Details
-
TrustConfig
public TrustConfig()
-
-
Method Details
-
certificateFromPath
Load certificate data from a given path in the system. The certificate can be in PEM, P7B/PKCS#7 or DER format.- Parameters:
certificatePath- path to the certificate file.
-
certificateFromClasspath
Load certificate data from the classpath. The certificate can be in PEM, P7B/PKCS#7 or DER format.- Parameters:
certificateFile- The name of the certificate file in the classpath.
-
certificateFromInputStream
Load certificate data from a given input stream. The certificate can be in PEM, P7B/PKCS#7 or DER format.- Parameters:
certificateInputStream- input stream to the certificate file.
-
p7bCertificateFromString
Load P7B certificate data from a given string. The certificate must be in P7B/PKCS#7 format.- Parameters:
certificateString- P7B encoded certificate.
-
pemFromString
Load pem formatted identity data from a given string. The certificate must be in PEM format.- Parameters:
certificateString- PEM encoded certificate.
-
trustStoreFromPath
Load a trust store from a given path in the system. The trust store can be in JKS or PKCS12 format.- Parameters:
trustStorePath- path to the trust store file.trustStorePassword- password for the trust store.
-
trustStoreFromInputStream
Load a trust store from a given input stream. The trust store can be in JKS or PKCS12 format.- Parameters:
trustStoreInputStream- input stream to the trust store file.trustStorePassword- password for the trust store.
-
trustStoreFromClasspath
Load a trust store from the classpath.- Parameters:
trustStoreFile- The name of the trust store file in the classpath.trustStorePassword- password for the trust store.
-