Class BrokerSSLConfigV2


  • public class BrokerSSLConfigV2
    extends java.lang.Object
    This class is a data structure used to describe a broker's SSL configuration.
    • Constructor Detail

      • BrokerSSLConfigV2

        public BrokerSSLConfigV2()
        Create an empty SSL config object
    • Method Detail

      • getKeystore

        public java.lang.String getKeystore()
        Get the SSL Keystore used by this configuration
        Returns:
        the SSL Keystore
      • setKeystore

        public void setKeystore​(java.lang.String newKeystore)
        Set the SSL Keystore used by this configuration. The newKeystore parameter must be the full path to the keystore file on the machine where the Broker Server is running.
        Parameters:
        newKeystore - path to keystore
      • getKeystorePassword

        public java.lang.String getKeystorePassword()
        Returns the password for the keystore
        Returns:
        the password for the keystore
      • setKeystorePassword

        public void setKeystorePassword​(java.lang.String newPassword)
        Set the password for the keystore
        Parameters:
        newPassword - keystore password
      • setKeystoreType

        public void setKeystoreType​(BrokerSSLConfigV2.KeystoreType newKeystoreType)
        Set the keystore file type.
        Parameters:
        newKeystoreType - the type of the keystore file
      • setKeystoreType

        public void setKeystoreType​(java.lang.String newKeystoreType)
                             throws BrokerSSLConfigException
        Set the keystore file type. The type must be:
      • KEYSTORE_TYPE_PKCS12/code>
      • KEYSTORE_TYPE_PEM or
      • null

        If the type is null, then the default keystore type (KEYSTORE_TYPE_PKCS12) is used.

Parameters:
newKeystoreType - the type of the keystore file
Throws:
BrokerSSLConfigException - if the keystore type is not valid
  • getTruststore

    public java.lang.String getTruststore()
    Get the SSL Truststore used by this configuration
    Returns:
    the SSL Truststore
  • setTruststore

    public void setTruststore​(java.lang.String newTruststore)
    Set the SSL Truststore used by this configuration. The newTruststore parameter must be the full path to the truststore file on the machine where the Broker Server is running.
    Parameters:
    newTruststore - path to keystore
  • setTruststoreType

    public void setTruststoreType​(BrokerSSLConfigV2.TruststoreType newTruststoreType)
    Set the truststore file type.
    Parameters:
    newTruststoreType - the type of the truststore file
  • setTruststoreType

    public void setTruststoreType​(java.lang.String newTruststoreType)
                           throws BrokerSSLConfigException
    Set the truststore file type. The type must be:
  • TRUSTSTORE_TYPE_PEM/code>
  • TRUSTSTORE_TYPE_DIR or
  • null

    If the type is null, then the default truststore type (TRUSTSTORE_TYPE_PEM) is used.

Parameters:
newTruststoreType - the type of the truststore file
Throws:
BrokerSSLConfigException - if the truststore type is not valid
  • getSslProtocol

    public BrokerSSLConfigV2.SSLProtocol getSslProtocol()
    Get the current SSL Protocols allowed
    Returns:
    the current SSL protocols allowed with this configuration
  • setSslProtocol

    public void setSslProtocol​(java.lang.String newSslProtocol)
                        throws BrokerSSLConfigException
    Set the SSL protocols that this configuration allows. The allowed values are:
  • SSL_PROTOCOL_ALL
  • SSL_PROTOCOL_SSLV3 or
  • SSL_PROTOCOL_TLSV1 or
  • null

    If the type is null, then the default SSL protocol type (SSL_PROTOCOL_ALL) is used.

    SSL_PROTOCOL_ALL allows the use of either SSLv3 or TLSv1. It does not allow SSLv2 or earlier.

    Parameters:
    newSslProtocol - the protocols to allow
    Throws:
    BrokerSSLConfigException - if the specified protocol is not valid
  • getCrl

    public java.lang.String getCrl()
    Get the SSL Crl used by this configuration
    Returns:
    the path to the SSL CRL file used by this configuration.
  • setCrl

    public void setCrl​(java.lang.String crl)
    Set the SSL Crl used by this configuration. The crl parameter must be the full path to the crl file on the machine where the Broker Server is running.
    Parameters:
    crl - path to crl
  • setCrlType

    public void setCrlType​(java.lang.String crlType)
                    throws BrokerSSLConfigException
    Set the crl file type. The type must be:
  • PEM
  • ,
  • DER
  • If the crl type is null, then the default crl type (PEM) is used.

    Parameters:
    crlType - the type of the crl file
    Throws:
    BrokerSSLConfigException - if the crl type is not valid
  • getCipherSuites

    public java.lang.String getCipherSuites()
    Return the current cipher suites specification for this configuration
    Returns:
    the current cipher suites string
  • setCipherSuites

    public void setCipherSuites​(java.lang.String newCipherSuites)
    Specify the cipher suites to allow with this configuration.

    The string must be in OpenSSL format but is not checked by the API.

    Parameters:
    newCipherSuites - the cipher suite specification
  • getVerifyDepth

    public int getVerifyDepth()
    Get the number of CA certificates in a verification chain to check. If the certificate chain exceeds this number, then the connection is rejected.
    Returns:
    the current maximum number
  • setVerifyDepth

    public void setVerifyDepth​(int newVerifyDepth)
                        throws BrokerSSLConfigException
    Set the maximum number of CA certificates to verify in a certificate chain.

    The default is 9.

    Parameters:
    newVerifyDepth - the max number of certificates to verify
    Throws:
    BrokerSSLConfigException - if the specified number is less than zero
  • equals

    public boolean equals​(java.lang.Object sslConfig)
    Overrides:
    equals in class java.lang.Object
  • hashCode

    public int hashCode()
    Overrides:
    hashCode in class java.lang.Object
  • toString

    public java.lang.String toString​(int indent_level)
    Convert to a string. The "indent_level" is the number of 4-space indents that the output should be generated for.