com.marklogic.xcc

## Class SecurityOptions

- java.lang.Object
- - com.marklogic.xcc.SecurityOptions

-     public class SecurityOptions
      extends java.lang.Object

  This class contains the SSL security options to be used by secure XCC connections. Secure ContentSource objects

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SecurityOptions(SecurityOptions prototype)`
    `SecurityOptions(javax.net.ssl.SSLContext context)` Construct a new SecurityOptions instance with the specified SSL context.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object o)` Returns true if the passed object is a SecurityOptions instance that has the same enabled ciphers and protocols, and references the same SSLContext instance.
    `java.lang.String[]` | `getEnabledCipherSuites()` Return the names of the SSL cipher suites which are to be enabled when new XCCS connections are created.
    `java.lang.String[]` | `getEnabledProtocols()` Return the names of the protocol versions which are to be enabled when new XCCS connections are created.
    `javax.net.ssl.SSLContext` | `getSslContext()` Return the SSL Context that will be used for new XCCS connections.
    `int` | `hashCode()` Returns a computed hash based on the enabled cipher and protocol names, and the hashCode of the sslContext, if set.
    `void` | `setEnabledCipherSuites(java.lang.String[] enabledCipherSuites)` Set the cipher suites enabled when new XCCS connections are created.
    `void` | `setEnabledProtocols(java.lang.String[] enabledProtocols)` Set the protocol versions enabled when new XCCS connections are created.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SecurityOptions

          public SecurityOptions(javax.net.ssl.SSLContext context)

      Construct a new SecurityOptions instance with the specified SSL context.
      Parameters:
        `context` - The SSL context.

    - #### SecurityOptions

          public SecurityOptions(SecurityOptions prototype)

  - ### Method Detail

    - #### getEnabledProtocols

          public java.lang.String[] getEnabledProtocols()

      Return the names of the protocol versions which are to be enabled when new XCCS connections are created. The returned array is a sorted copy of the protocols list; changes to it will not affect this object or anything that uses it.

      Returns:
        An array of protocols, or null if the SSLContext's defaults are to be used.
      See Also:
        `setEnabledProtocols(String[] enabledProtocols)`

    - #### getSslContext

          public javax.net.ssl.SSLContext getSslContext()

      Return the SSL Context that will be used for new XCCS connections.

      Returns:
        The SSLContext object.

    - #### setEnabledProtocols

          public void setEnabledProtocols(java.lang.String[] enabledProtocols)

      Set the protocol versions enabled when new XCCS connections are created. Following a successful call to this method, only protocols listed in the protocols parameter are enabled for use.

      Parameters:
        `enabledProtocols` - Names of all the protocols to enable.
      See Also:
        `getEnabledProtocols()`

    - #### getEnabledCipherSuites

          public java.lang.String[] getEnabledCipherSuites()

      Return the names of the SSL cipher suites which are to be enabled when new XCCS connections are created.

      Even if a suite has been enabled, it might never be used. (For example, the peer does not support it, the requisite certificates (and private keys) for the suite are not available, or an anonymous suite is enabled but authentication is required. The returned array is a sorted copy of the cipher suites list; changes to it will not affect this object or anything that uses it.

      Returns:
        An array of enabled cipher suite names, or null if the SSL context's defaults are to be used.
      See Also:
        `setEnabledCipherSuites(String[] enabledCipherSuites)`

    - #### setEnabledCipherSuites

          public void setEnabledCipherSuites(java.lang.String[] enabledCipherSuites)

      Set the cipher suites enabled when new XCCS connections are created. Following a successful call to this method, only suites listed in the suites parameter are enabled for use.

      See `getEnabledCipherSuites()` for more information on why a specific cipher suite may never be used on a connection.

      Parameters:
        `enabledCipherSuites` - Names of all the cipher suites to enable.
      See Also:
        `getEnabledCipherSuites()`

    - #### hashCode

          public int hashCode()

      Returns a computed hash based on the enabled cipher and protocol names, and the hashCode of the sslContext, if set.
      Overrides:
        `hashCode` in class `java.lang.Object`
      Returns:
        a content-based hash code for this object.

    - #### equals

          public boolean equals(java.lang.Object o)

      Returns true if the passed object is a SecurityOptions instance that has the same enabled ciphers and protocols, and references the same SSLContext instance.

      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `o` - the reference object with which to compare.
      Returns:
        if this object is the same as the obj argument; false otherwise.

Copyright © 2025 MarkLogic Corporation. All Rights Reserved.

Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com