Class TrustConfig
-
- All Implemented Interfaces:
public final class TrustConfigConfiguration 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
Fields Modifier and Type Field Description private final List<Certificate>certificatesprivate List<KeyStore>keyStoreMutableListprivate List<KeyStore>keyStore
-
Constructor Summary
Constructors Constructor Description TrustConfig()
-
Method Summary
Modifier and Type Method Description final List<Certificate>getCertificates()List of certificates to be trusted, can be loaded using the helper methods or directly. final List<KeyStore>getKeyStoreMutableList()final UnitsetKeyStoreMutableList(List<KeyStore> keyStoreMutableList)final List<KeyStore>getKeyStore()List of KeyStores to be trusted, can be loaded using the helper methods or directly. final UnitsetKeyStore(List<KeyStore> keyStore)List of KeyStores to be trusted, can be loaded using the helper methods or directly. final UnitcertificateFromPath(String certificatePath)Load certificate data from a given path in the system. final UnitcertificateFromClasspath(String certificateFile)Load certificate data from the classpath. final UnitcertificateFromInputStream(InputStream certificateInputStream)Load certificate data from a given input stream. final Unitp7bCertificateFromString(String certificateString)Load P7B certificate data from a given string. final UnitpemFromString(String certificateString)Load pem formatted identity data from a given string. final UnittrustStoreFromPath(String trustStorePath, String trustStorePassword)Load a trust store from a given path in the system. final UnittrustStoreFromInputStream(InputStream trustStoreInputStream, String trustStorePassword)Load a trust store from a given input stream. final UnittrustStoreFromClasspath(String trustStoreFile, String trustStorePassword)Load a trust store from the classpath. -
-
Method Detail
-
getCertificates
final List<Certificate> getCertificates()
List of certificates to be trusted, can be loaded using the helper methods or directly. This list is complementary to the keys
-
getKeyStoreMutableList
final List<KeyStore> getKeyStoreMutableList()
-
setKeyStoreMutableList
final Unit setKeyStoreMutableList(List<KeyStore> keyStoreMutableList)
-
getKeyStore
final List<KeyStore> getKeyStore()
List of KeyStores to be trusted, can be loaded using the helper methods or directly.
-
setKeyStore
final Unit setKeyStore(List<KeyStore> keyStore)
List of KeyStores to be trusted, can be loaded using the helper methods or directly.
-
certificateFromPath
final Unit certificateFromPath(String certificatePath)
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
final Unit certificateFromClasspath(String certificateFile)
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
final Unit certificateFromInputStream(InputStream certificateInputStream)
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
final Unit p7bCertificateFromString(String certificateString)
Load P7B certificate data from a given string. The certificate must be in P7B/PKCS#7 format.
- Parameters:
certificateString- P7B encoded certificate.
-
pemFromString
final Unit pemFromString(String certificateString)
Load pem formatted identity data from a given string. The certificate must be in PEM format.
- Parameters:
certificateString- PEM encoded certificate.
-
trustStoreFromPath
final Unit trustStoreFromPath(String trustStorePath, String trustStorePassword)
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
final Unit trustStoreFromInputStream(InputStream trustStoreInputStream, String trustStorePassword)
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
final Unit trustStoreFromClasspath(String trustStoreFile, String trustStorePassword)
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.
-
-
-
-