Class TrustConfig

  • All Implemented Interfaces:

    
    public final class 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.

    • Constructor Detail

      • TrustConfig

        TrustConfig()
    • 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

      • 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.