SSL (Apache Tomcat 7.0.104 API Documentation)

org.apache.tomcat.jni

## Class SSL

- java.lang.Object
- - org.apache.tomcat.jni.SSL

-     public final class SSL
      extends Object

  SSL
  Author:
    Mladen Turk

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `SSL_AIDX_DSA`
    `static int` | `SSL_AIDX_MAX`
    `static int` | `SSL_AIDX_RSA`
    `static int` | `SSL_ALGO_ALL`
    `static int` | `SSL_ALGO_DSA`
    `static int` | `SSL_ALGO_RSA`
    `static int` | `SSL_ALGO_UNKNOWN`
    `static int` | `SSL_CRT_FORMAT_ASN1`
    `static int` | `SSL_CRT_FORMAT_ENGINE`
    `static int` | `SSL_CRT_FORMAT_NETSCAPE`
    `static int` | `SSL_CRT_FORMAT_PEM`
    `static int` | `SSL_CRT_FORMAT_PKCS12`
    `static int` | `SSL_CRT_FORMAT_SMIME`
    `static int` | `SSL_CRT_FORMAT_TEXT`
    `static int` | `SSL_CRT_FORMAT_UNDEF`
    `static int` | `SSL_CVERIFY_NONE`
    `static int` | `SSL_CVERIFY_OPTIONAL`
    `static int` | `SSL_CVERIFY_OPTIONAL_NO_CA`
    `static int` | `SSL_CVERIFY_REQUIRE`
    `static int` | `SSL_CVERIFY_UNSET`
    `static int` | `SSL_INFO_CIPHER`
    `static int` | `SSL_INFO_CIPHER_ALGKEYSIZE`
    `static int` | `SSL_INFO_CIPHER_DESCRIPTION`
    `static int` | `SSL_INFO_CIPHER_USEKEYSIZE`
    `static int` | `SSL_INFO_CIPHER_VERSION`
    `static int` | `SSL_INFO_CLIENT_A_KEY`
    `static int` | `SSL_INFO_CLIENT_A_SIG`
    `static int` | `SSL_INFO_CLIENT_CERT`
    `static int` | `SSL_INFO_CLIENT_CERT_CHAIN`
    `static int` | `SSL_INFO_CLIENT_I_DN`
    `static int` | `SSL_INFO_CLIENT_M_SERIAL`
    `static int` | `SSL_INFO_CLIENT_M_VERSION`
    `static int` | `SSL_INFO_CLIENT_S_DN`
    `static int` | `SSL_INFO_CLIENT_V_END`
    `static int` | `SSL_INFO_CLIENT_V_REMAIN`
    `static int` | `SSL_INFO_CLIENT_V_START`
    `static int` | `SSL_INFO_DN_COMMONNAME`
    `static int` | `SSL_INFO_DN_COUNTRYNAME`
    `static int` | `SSL_INFO_DN_DESCRIPTION`
    `static int` | `SSL_INFO_DN_EMAILADDRESS`
    `static int` | `SSL_INFO_DN_GIVENNAME`
    `static int` | `SSL_INFO_DN_INITIALS`
    `static int` | `SSL_INFO_DN_LOCALITYNAME`
    `static int` | `SSL_INFO_DN_ORGANIZATIONALUNITNAME`
    `static int` | `SSL_INFO_DN_ORGANIZATIONNAME`
    `static int` | `SSL_INFO_DN_STATEORPROVINCENAME`
    `static int` | `SSL_INFO_DN_SURNAME`
    `static int` | `SSL_INFO_DN_TITLE`
    `static int` | `SSL_INFO_DN_UNIQUEIDENTIFIER`
    `static int` | `SSL_INFO_PROTOCOL`
    `static int` | `SSL_INFO_SERVER_A_KEY`
    `static int` | `SSL_INFO_SERVER_A_SIG`
    `static int` | `SSL_INFO_SERVER_CERT`
    `static int` | `SSL_INFO_SERVER_I_DN`
    `static int` | `SSL_INFO_SERVER_M_SERIAL`
    `static int` | `SSL_INFO_SERVER_M_VERSION`
    `static int` | `SSL_INFO_SERVER_S_DN`
    `static int` | `SSL_INFO_SERVER_V_END`
    `static int` | `SSL_INFO_SERVER_V_START`
    `static int` | `SSL_INFO_SESSION_ID`
    `static int` | `SSL_MODE_CLIENT`
    `static int` | `SSL_MODE_COMBINED`
    `static int` | `SSL_MODE_SERVER`
    `static int` | `SSL_OP_ALL`
    `static int` | `SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION`
    `static int` | `SSL_OP_CIPHER_SERVER_PREFERENCE`
    `static int` | `SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS`
    `static int` | `SSL_OP_EPHEMERAL_RSA`
    `static int` | `SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER`
    `static int` | `SSL_OP_MICROSOFT_SESS_ID_BUG`
    `static int` | `SSL_OP_MSIE_SSLV2_RSA_PADDING`
    `static int` | `SSL_OP_NETSCAPE_CA_DN_BUG`
    `static int` | `SSL_OP_NETSCAPE_CHALLENGE_BUG`
    `static int` | `SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG`
    `static int` | `SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG`
    `static int` | `SSL_OP_NO_COMPRESSION`
    `static int` | `SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION`
    `static int` | `SSL_OP_NO_SSLv2`
    `static int` | `SSL_OP_NO_SSLv3`
    `static int` | `SSL_OP_NO_TICKET`
    `static int` | `SSL_OP_NO_TLSv1`
    `static int` | `SSL_OP_NO_TLSv1_1`
    `static int` | `SSL_OP_NO_TLSv1_2`
    `static int` | `SSL_OP_PKCS1_CHECK_1` Deprecated. Unsupported in the current version of OpenSSL
    `static int` | `SSL_OP_PKCS1_CHECK_2` Deprecated. Unsupported in the current version of OpenSSL
    `static int` | `SSL_OP_SINGLE_DH_USE`
    `static int` | `SSL_OP_SINGLE_ECDH_USE`
    `static int` | `SSL_OP_SSLEAY_080_CLIENT_DH_BUG`
    `static int` | `SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG`
    `static int` | `SSL_OP_TLS_BLOCK_PADDING_BUG`
    `static int` | `SSL_OP_TLS_D5_BUG`
    `static int` | `SSL_OP_TLS_ROLLBACK_BUG`
    `static int` | `SSL_OPT_ALL`
    `static int` | `SSL_OPT_EXPORTCERTDATA`
    `static int` | `SSL_OPT_FAKEBASICAUTH`
    `static int` | `SSL_OPT_NONE`
    `static int` | `SSL_OPT_OPTRENEGOTIATE`
    `static int` | `SSL_OPT_RELSET`
    `static int` | `SSL_OPT_STDENVVARS`
    `static int` | `SSL_OPT_STRICTREQUIRE`
    `static int` | `SSL_PROTOCOL_ALL`
    `static int` | `SSL_PROTOCOL_NONE`
    `static int` | `SSL_PROTOCOL_SSLV2`
    `static int` | `SSL_PROTOCOL_SSLV3`
    `static int` | `SSL_PROTOCOL_TLSV1`
    `static int` | `SSL_PROTOCOL_TLSV1_1`
    `static int` | `SSL_PROTOCOL_TLSV1_2`
    `static int` | `SSL_PROTOCOL_TLSV1_3`
    `static int` | `SSL_SHUTDOWN_TYPE_ACCURATE`
    `static int` | `SSL_SHUTDOWN_TYPE_STANDARD`
    `static int` | `SSL_SHUTDOWN_TYPE_UNCLEAN`
    `static int` | `SSL_SHUTDOWN_TYPE_UNSET`
    `static int` | `SSL_TMP_KEY_DH_1024`
    `static int` | `SSL_TMP_KEY_DH_2048`
    `static int` | `SSL_TMP_KEY_DH_4096`
    `static int` | `SSL_TMP_KEY_DH_512`
    `static int` | `SSL_TMP_KEY_MAX`
    `static int` | `SSL_TMP_KEY_RSA_1024`
    `static int` | `SSL_TMP_KEY_RSA_2048`
    `static int` | `SSL_TMP_KEY_RSA_4096`
    `static int` | `SSL_TMP_KEY_RSA_512`
    `static int` | `SSL_VERIFY_CLIENT_ONCE`
    `static int` | `SSL_VERIFY_FAIL_IF_NO_PEER_CERT`
    `static int` | `SSL_VERIFY_NONE`
    `static int` | `SSL_VERIFY_PEER`
    `static int` | `SSL_VERIFY_PEER_STRICT`
    `static int` | `UNSET`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SSL()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `closeBIO(long bio)` Close BIO and dereference callback object
    `static int` | `fipsModeGet()` Get the status of FIPS Mode.
    `static int` | `fipsModeSet(int mode)` Enable/Disable FIPS Mode.
    `static boolean` | `generateRSATempKey(int idx)` Deprecated. Only useful in combination with EXPORT Cipher
    `static String` | `getLastError()` Return last SSL error string
    `static boolean` | `hasOp(int op)` Return true if all the requested SSL_OP_* are supported by OpenSSL.
    `static int` | `initialize(String engine)` Initialize OpenSSL support.
    `static boolean` | `loadDSATempKey(int idx, String file)` Deprecated. Now automatically loaded from certificate file
    `static long` | `newBIO(long pool, BIOCallback callback)` Initialize new BIO
    `static boolean` | `randLoad(String filename)` Add content of the file to the PRNG
    `static boolean` | `randMake(String filename, int len, boolean base64)` Creates random data to filename
    `static boolean` | `randSave(String filename)` Writes a number of random bytes (currently 1024) to file `filename` which can be used to initialize the PRNG by calling randLoad in a later session.
    `static void` | `randSet(String filename)` Sets global random filename.
    `static void` | `setPassword(String password)` Set global Password for decrypting certificates and keys.
    `static void` | `setPasswordCallback(PasswordCallback callback)` Set global Password callback for obtaining passwords.
    `static int` | `version()`
    `static String` | `versionString()`

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

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

- - ### Field Detail

    - #### UNSET

          public static final int UNSET

      See Also:
        Constant Field Values

    - #### SSL_ALGO_UNKNOWN

          public static final int SSL_ALGO_UNKNOWN

      See Also:
        Constant Field Values

    - #### SSL_ALGO_RSA

          public static final int SSL_ALGO_RSA

      See Also:
        Constant Field Values

    - #### SSL_ALGO_DSA

          public static final int SSL_ALGO_DSA

      See Also:
        Constant Field Values

    - #### SSL_ALGO_ALL

          public static final int SSL_ALGO_ALL

      See Also:
        Constant Field Values

    - #### SSL_AIDX_RSA

          public static final int SSL_AIDX_RSA

      See Also:
        Constant Field Values

    - #### SSL_AIDX_DSA

          public static final int SSL_AIDX_DSA

      See Also:
        Constant Field Values

    - #### SSL_AIDX_MAX

          public static final int SSL_AIDX_MAX

      See Also:
        Constant Field Values

    - #### SSL_TMP_KEY_RSA_512

          public static final int SSL_TMP_KEY_RSA_512

      See Also:
        Constant Field Values

    - #### SSL_TMP_KEY_RSA_1024

          public static final int SSL_TMP_KEY_RSA_1024

      See Also:
        Constant Field Values

    - #### SSL_TMP_KEY_RSA_2048

          public static final int SSL_TMP_KEY_RSA_2048

      See Also:
        Constant Field Values

    - #### SSL_TMP_KEY_RSA_4096

          public static final int SSL_TMP_KEY_RSA_4096

      See Also:
        Constant Field Values

    - #### SSL_TMP_KEY_DH_512

          public static final int SSL_TMP_KEY_DH_512

      See Also:
        Constant Field Values

    - #### SSL_TMP_KEY_DH_1024

          public static final int SSL_TMP_KEY_DH_1024

      See Also:
        Constant Field Values

    - #### SSL_TMP_KEY_DH_2048

          public static final int SSL_TMP_KEY_DH_2048

      See Also:
        Constant Field Values

    - #### SSL_TMP_KEY_DH_4096

          public static final int SSL_TMP_KEY_DH_4096

      See Also:
        Constant Field Values

    - #### SSL_TMP_KEY_MAX

          public static final int SSL_TMP_KEY_MAX

      See Also:
        Constant Field Values

    - #### SSL_OPT_NONE

          public static final int SSL_OPT_NONE

      See Also:
        Constant Field Values

    - #### SSL_OPT_RELSET

          public static final int SSL_OPT_RELSET

      See Also:
        Constant Field Values

    - #### SSL_OPT_STDENVVARS

          public static final int SSL_OPT_STDENVVARS

      See Also:
        Constant Field Values

    - #### SSL_OPT_EXPORTCERTDATA

          public static final int SSL_OPT_EXPORTCERTDATA

      See Also:
        Constant Field Values

    - #### SSL_OPT_FAKEBASICAUTH

          public static final int SSL_OPT_FAKEBASICAUTH

      See Also:
        Constant Field Values

    - #### SSL_OPT_STRICTREQUIRE

          public static final int SSL_OPT_STRICTREQUIRE

      See Also:
        Constant Field Values

    - #### SSL_OPT_OPTRENEGOTIATE

          public static final int SSL_OPT_OPTRENEGOTIATE

      See Also:
        Constant Field Values

    - #### SSL_OPT_ALL

          public static final int SSL_OPT_ALL

      See Also:
        Constant Field Values

    - #### SSL_PROTOCOL_NONE

          public static final int SSL_PROTOCOL_NONE

      See Also:
        Constant Field Values

    - #### SSL_PROTOCOL_SSLV2

          public static final int SSL_PROTOCOL_SSLV2

      See Also:
        Constant Field Values

    - #### SSL_PROTOCOL_SSLV3

          public static final int SSL_PROTOCOL_SSLV3

      See Also:
        Constant Field Values

    - #### SSL_PROTOCOL_TLSV1

          public static final int SSL_PROTOCOL_TLSV1

      See Also:
        Constant Field Values

    - #### SSL_PROTOCOL_TLSV1_1

          public static final int SSL_PROTOCOL_TLSV1_1

      See Also:
        Constant Field Values

    - #### SSL_PROTOCOL_TLSV1_2

          public static final int SSL_PROTOCOL_TLSV1_2

      See Also:
        Constant Field Values

    - #### SSL_PROTOCOL_TLSV1_3

          public static final int SSL_PROTOCOL_TLSV1_3

      See Also:
        Constant Field Values

    - #### SSL_PROTOCOL_ALL

          public static final int SSL_PROTOCOL_ALL

      See Also:
        Constant Field Values

    - #### SSL_CVERIFY_UNSET

          public static final int SSL_CVERIFY_UNSET

      See Also:
        Constant Field Values

    - #### SSL_CVERIFY_NONE

          public static final int SSL_CVERIFY_NONE

      See Also:
        Constant Field Values

    - #### SSL_CVERIFY_OPTIONAL

          public static final int SSL_CVERIFY_OPTIONAL

      See Also:
        Constant Field Values

    - #### SSL_CVERIFY_REQUIRE

          public static final int SSL_CVERIFY_REQUIRE

      See Also:
        Constant Field Values

    - #### SSL_CVERIFY_OPTIONAL_NO_CA

          public static final int SSL_CVERIFY_OPTIONAL_NO_CA

      See Also:
        Constant Field Values

    - #### SSL_VERIFY_NONE

          public static final int SSL_VERIFY_NONE

      See Also:
        Constant Field Values

    - #### SSL_VERIFY_PEER

          public static final int SSL_VERIFY_PEER

      See Also:
        Constant Field Values

    - #### SSL_VERIFY_FAIL_IF_NO_PEER_CERT

          public static final int SSL_VERIFY_FAIL_IF_NO_PEER_CERT

      See Also:
        Constant Field Values

    - #### SSL_VERIFY_CLIENT_ONCE

          public static final int SSL_VERIFY_CLIENT_ONCE

      See Also:
        Constant Field Values

    - #### SSL_VERIFY_PEER_STRICT

          public static final int SSL_VERIFY_PEER_STRICT

      See Also:
        Constant Field Values

    - #### SSL_OP_MICROSOFT_SESS_ID_BUG

          public static final int SSL_OP_MICROSOFT_SESS_ID_BUG

      See Also:
        Constant Field Values

    - #### SSL_OP_NETSCAPE_CHALLENGE_BUG

          public static final int SSL_OP_NETSCAPE_CHALLENGE_BUG

      See Also:
        Constant Field Values

    - #### SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG

          public static final int SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG

      See Also:
        Constant Field Values

    - #### SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG

          public static final int SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG

      See Also:
        Constant Field Values

    - #### SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER

          public static final int SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER

      See Also:
        Constant Field Values

    - #### SSL_OP_MSIE_SSLV2_RSA_PADDING

          public static final int SSL_OP_MSIE_SSLV2_RSA_PADDING

      See Also:
        Constant Field Values

    - #### SSL_OP_SSLEAY_080_CLIENT_DH_BUG

          public static final int SSL_OP_SSLEAY_080_CLIENT_DH_BUG

      See Also:
        Constant Field Values

    - #### SSL_OP_TLS_D5_BUG

          public static final int SSL_OP_TLS_D5_BUG

      See Also:
        Constant Field Values

    - #### SSL_OP_TLS_BLOCK_PADDING_BUG

          public static final int SSL_OP_TLS_BLOCK_PADDING_BUG

      See Also:
        Constant Field Values

    - #### SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS

          public static final int SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS

      See Also:
        Constant Field Values

    - #### SSL_OP_ALL

          public static final int SSL_OP_ALL

      See Also:
        Constant Field Values

    - #### SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION

          public static final int SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION

      See Also:
        Constant Field Values

    - #### SSL_OP_NO_COMPRESSION

          public static final int SSL_OP_NO_COMPRESSION

      See Also:
        Constant Field Values

    - #### SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION

          public static final int SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION

      See Also:
        Constant Field Values

    - #### SSL_OP_SINGLE_ECDH_USE

          public static final int SSL_OP_SINGLE_ECDH_USE

      See Also:
        Constant Field Values

    - #### SSL_OP_SINGLE_DH_USE

          public static final int SSL_OP_SINGLE_DH_USE

      See Also:
        Constant Field Values

    - #### SSL_OP_EPHEMERAL_RSA

          public static final int SSL_OP_EPHEMERAL_RSA

      See Also:
        Constant Field Values

    - #### SSL_OP_CIPHER_SERVER_PREFERENCE

          public static final int SSL_OP_CIPHER_SERVER_PREFERENCE

      See Also:
        Constant Field Values

    - #### SSL_OP_TLS_ROLLBACK_BUG

          public static final int SSL_OP_TLS_ROLLBACK_BUG

      See Also:
        Constant Field Values

    - #### SSL_OP_NO_SSLv2

          public static final int SSL_OP_NO_SSLv2

      See Also:
        Constant Field Values

    - #### SSL_OP_NO_SSLv3

          public static final int SSL_OP_NO_SSLv3

      See Also:
        Constant Field Values

    - #### SSL_OP_NO_TLSv1

          public static final int SSL_OP_NO_TLSv1

      See Also:
        Constant Field Values

    - #### SSL_OP_NO_TLSv1_2

          public static final int SSL_OP_NO_TLSv1_2

      See Also:
        Constant Field Values

    - #### SSL_OP_NO_TLSv1_1

          public static final int SSL_OP_NO_TLSv1_1

      See Also:
        Constant Field Values

    - #### SSL_OP_NO_TICKET

          public static final int SSL_OP_NO_TICKET

      See Also:
        Constant Field Values

    - #### SSL_OP_PKCS1_CHECK_1

          @Deprecated
          public static final int SSL_OP_PKCS1_CHECK_1

      Deprecated. Unsupported in the current version of OpenSSL
      See Also:
        Constant Field Values

    - #### SSL_OP_PKCS1_CHECK_2

          @Deprecated
          public static final int SSL_OP_PKCS1_CHECK_2

      Deprecated. Unsupported in the current version of OpenSSL
      See Also:
        Constant Field Values

    - #### SSL_OP_NETSCAPE_CA_DN_BUG

          public static final int SSL_OP_NETSCAPE_CA_DN_BUG

      See Also:
        Constant Field Values

    - #### SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG

          public static final int SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG

      See Also:
        Constant Field Values

    - #### SSL_CRT_FORMAT_UNDEF

          public static final int SSL_CRT_FORMAT_UNDEF

      See Also:
        Constant Field Values

    - #### SSL_CRT_FORMAT_ASN1

          public static final int SSL_CRT_FORMAT_ASN1

      See Also:
        Constant Field Values

    - #### SSL_CRT_FORMAT_TEXT

          public static final int SSL_CRT_FORMAT_TEXT

      See Also:
        Constant Field Values

    - #### SSL_CRT_FORMAT_PEM

          public static final int SSL_CRT_FORMAT_PEM

      See Also:
        Constant Field Values

    - #### SSL_CRT_FORMAT_NETSCAPE

          public static final int SSL_CRT_FORMAT_NETSCAPE

      See Also:
        Constant Field Values

    - #### SSL_CRT_FORMAT_PKCS12

          public static final int SSL_CRT_FORMAT_PKCS12

      See Also:
        Constant Field Values

    - #### SSL_CRT_FORMAT_SMIME

          public static final int SSL_CRT_FORMAT_SMIME

      See Also:
        Constant Field Values

    - #### SSL_CRT_FORMAT_ENGINE

          public static final int SSL_CRT_FORMAT_ENGINE

      See Also:
        Constant Field Values

    - #### SSL_MODE_CLIENT

          public static final int SSL_MODE_CLIENT

      See Also:
        Constant Field Values

    - #### SSL_MODE_SERVER

          public static final int SSL_MODE_SERVER

      See Also:
        Constant Field Values

    - #### SSL_MODE_COMBINED

          public static final int SSL_MODE_COMBINED

      See Also:
        Constant Field Values

    - #### SSL_SHUTDOWN_TYPE_UNSET

          public static final int SSL_SHUTDOWN_TYPE_UNSET

      See Also:
        Constant Field Values

    - #### SSL_SHUTDOWN_TYPE_STANDARD

          public static final int SSL_SHUTDOWN_TYPE_STANDARD

      See Also:
        Constant Field Values

    - #### SSL_SHUTDOWN_TYPE_UNCLEAN

          public static final int SSL_SHUTDOWN_TYPE_UNCLEAN

      See Also:
        Constant Field Values

    - #### SSL_SHUTDOWN_TYPE_ACCURATE

          public static final int SSL_SHUTDOWN_TYPE_ACCURATE

      See Also:
        Constant Field Values

    - #### SSL_INFO_SESSION_ID

          public static final int SSL_INFO_SESSION_ID

      See Also:
        Constant Field Values

    - #### SSL_INFO_CIPHER

          public static final int SSL_INFO_CIPHER

      See Also:
        Constant Field Values

    - #### SSL_INFO_CIPHER_USEKEYSIZE

          public static final int SSL_INFO_CIPHER_USEKEYSIZE

      See Also:
        Constant Field Values

    - #### SSL_INFO_CIPHER_ALGKEYSIZE

          public static final int SSL_INFO_CIPHER_ALGKEYSIZE

      See Also:
        Constant Field Values

    - #### SSL_INFO_CIPHER_VERSION

          public static final int SSL_INFO_CIPHER_VERSION

      See Also:
        Constant Field Values

    - #### SSL_INFO_CIPHER_DESCRIPTION

          public static final int SSL_INFO_CIPHER_DESCRIPTION

      See Also:
        Constant Field Values

    - #### SSL_INFO_PROTOCOL

          public static final int SSL_INFO_PROTOCOL

      See Also:
        Constant Field Values

    - #### SSL_INFO_CLIENT_S_DN

          public static final int SSL_INFO_CLIENT_S_DN

      See Also:
        Constant Field Values

    - #### SSL_INFO_CLIENT_I_DN

          public static final int SSL_INFO_CLIENT_I_DN

      See Also:
        Constant Field Values

    - #### SSL_INFO_SERVER_S_DN

          public static final int SSL_INFO_SERVER_S_DN

      See Also:
        Constant Field Values

    - #### SSL_INFO_SERVER_I_DN

          public static final int SSL_INFO_SERVER_I_DN

      See Also:
        Constant Field Values

    - #### SSL_INFO_DN_COUNTRYNAME

          public static final int SSL_INFO_DN_COUNTRYNAME

      See Also:
        Constant Field Values

    - #### SSL_INFO_DN_STATEORPROVINCENAME

          public static final int SSL_INFO_DN_STATEORPROVINCENAME

      See Also:
        Constant Field Values

    - #### SSL_INFO_DN_LOCALITYNAME

          public static final int SSL_INFO_DN_LOCALITYNAME

      See Also:
        Constant Field Values

    - #### SSL_INFO_DN_ORGANIZATIONNAME

          public static final int SSL_INFO_DN_ORGANIZATIONNAME

      See Also:
        Constant Field Values

    - #### SSL_INFO_DN_ORGANIZATIONALUNITNAME

          public static final int SSL_INFO_DN_ORGANIZATIONALUNITNAME

      See Also:
        Constant Field Values

    - #### SSL_INFO_DN_COMMONNAME

          public static final int SSL_INFO_DN_COMMONNAME

      See Also:
        Constant Field Values

    - #### SSL_INFO_DN_TITLE

          public static final int SSL_INFO_DN_TITLE

      See Also:
        Constant Field Values

    - #### SSL_INFO_DN_INITIALS

          public static final int SSL_INFO_DN_INITIALS

      See Also:
        Constant Field Values

    - #### SSL_INFO_DN_GIVENNAME

          public static final int SSL_INFO_DN_GIVENNAME

      See Also:
        Constant Field Values

    - #### SSL_INFO_DN_SURNAME

          public static final int SSL_INFO_DN_SURNAME

      See Also:
        Constant Field Values

    - #### SSL_INFO_DN_DESCRIPTION

          public static final int SSL_INFO_DN_DESCRIPTION

      See Also:
        Constant Field Values

    - #### SSL_INFO_DN_UNIQUEIDENTIFIER

          public static final int SSL_INFO_DN_UNIQUEIDENTIFIER

      See Also:
        Constant Field Values

    - #### SSL_INFO_DN_EMAILADDRESS

          public static final int SSL_INFO_DN_EMAILADDRESS

      See Also:
        Constant Field Values

    - #### SSL_INFO_CLIENT_M_VERSION

          public static final int SSL_INFO_CLIENT_M_VERSION

      See Also:
        Constant Field Values

    - #### SSL_INFO_CLIENT_M_SERIAL

          public static final int SSL_INFO_CLIENT_M_SERIAL

      See Also:
        Constant Field Values

    - #### SSL_INFO_CLIENT_V_START

          public static final int SSL_INFO_CLIENT_V_START

      See Also:
        Constant Field Values

    - #### SSL_INFO_CLIENT_V_END

          public static final int SSL_INFO_CLIENT_V_END

      See Also:
        Constant Field Values

    - #### SSL_INFO_CLIENT_A_SIG

          public static final int SSL_INFO_CLIENT_A_SIG

      See Also:
        Constant Field Values

    - #### SSL_INFO_CLIENT_A_KEY

          public static final int SSL_INFO_CLIENT_A_KEY

      See Also:
        Constant Field Values

    - #### SSL_INFO_CLIENT_CERT

          public static final int SSL_INFO_CLIENT_CERT

      See Also:
        Constant Field Values

    - #### SSL_INFO_CLIENT_V_REMAIN

          public static final int SSL_INFO_CLIENT_V_REMAIN

      See Also:
        Constant Field Values

    - #### SSL_INFO_SERVER_M_VERSION

          public static final int SSL_INFO_SERVER_M_VERSION

      See Also:
        Constant Field Values

    - #### SSL_INFO_SERVER_M_SERIAL

          public static final int SSL_INFO_SERVER_M_SERIAL

      See Also:
        Constant Field Values

    - #### SSL_INFO_SERVER_V_START

          public static final int SSL_INFO_SERVER_V_START

      See Also:
        Constant Field Values

    - #### SSL_INFO_SERVER_V_END

          public static final int SSL_INFO_SERVER_V_END

      See Also:
        Constant Field Values

    - #### SSL_INFO_SERVER_A_SIG

          public static final int SSL_INFO_SERVER_A_SIG

      See Also:
        Constant Field Values

    - #### SSL_INFO_SERVER_A_KEY

          public static final int SSL_INFO_SERVER_A_KEY

      See Also:
        Constant Field Values

    - #### SSL_INFO_SERVER_CERT

          public static final int SSL_INFO_SERVER_CERT

      See Also:
        Constant Field Values

    - #### SSL_INFO_CLIENT_CERT_CHAIN

          public static final int SSL_INFO_CLIENT_CERT_CHAIN

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SSL

          public SSL()

  - ### Method Detail

    - #### version

          public static int version()

    - #### versionString

          public static String versionString()

    - #### initialize

          public static int initialize(String engine)

      Initialize OpenSSL support. This function needs to be called once for the lifetime of JVM. Library.init() has to be called before.
      Parameters:
        `engine` - Support for external a Crypto Device ("engine"), usually a hardware accelerator card for crypto operations.
      Returns:
        APR status code

    - #### fipsModeGet

          public static int fipsModeGet()
                                 throws Exception

      Get the status of FIPS Mode.
      Returns:
        FIPS_mode return code. It is `0` if OpenSSL is not in FIPS mode, `1` if OpenSSL is in FIPS Mode.
      Throws:
        `Exception` - If tcnative was not compiled with FIPS Mode available.
      See Also:
        OpenSSL method FIPS_mode()

    - #### fipsModeSet

          public static int fipsModeSet(int mode)
                                 throws Exception

      Enable/Disable FIPS Mode.
      Parameters:
        `mode` - 1 - enable, 0 - disable
      Returns:
        FIPS_mode_set return code
      Throws:
        `Exception` - If tcnative was not compiled with FIPS Mode available, or if `FIPS_mode_set()` call returned an error value.
      See Also:
        OpenSSL method FIPS_mode_set()

    - #### randLoad

          public static boolean randLoad(String filename)

      Add content of the file to the PRNG
      Parameters:
        `filename` - Filename containing random data. If null the default file will be tested. The seed file is $RANDFILE if that environment variable is set, $HOME/.rnd otherwise. In case both files are unavailable builtin random seed generator is used.
      Returns:
        `true` if the operation was successful

    - #### randSave

          public static boolean randSave(String filename)

      Writes a number of random bytes (currently 1024) to file `filename` which can be used to initialize the PRNG by calling randLoad in a later session.
      Parameters:
        `filename` - Filename to save the data
      Returns:
        `true` if the operation was successful

    - #### randMake

          public static boolean randMake(String filename,
                         int len,
                         boolean base64)

      Creates random data to filename
      Parameters:
        `filename` - Filename to save the data
        `len` - The length of random sequence in bytes
        `base64` - Output the data in Base64 encoded format
      Returns:
        `true` if the operation was successful

    - #### randSet

          public static void randSet(String filename)

      Sets global random filename.
      Parameters:
        `filename` - Filename to use. If set it will be used for SSL initialization and all contexts where explicitly not set.

    - #### newBIO

          public static long newBIO(long pool,
                    BIOCallback callback)
                             throws Exception

      Initialize new BIO
      Parameters:
        `pool` - The pool to use.
        `callback` - BIOCallback to use
      Returns:
        New BIO handle
      Throws:
        `Exception` - An error occurred

    - #### closeBIO

          public static int closeBIO(long bio)

      Close BIO and dereference callback object
      Parameters:
        `bio` - BIO to close and destroy.
      Returns:
        APR Status code

    - #### setPasswordCallback

          public static void setPasswordCallback(PasswordCallback callback)

      Set global Password callback for obtaining passwords.
      Parameters:
        `callback` - PasswordCallback implementation to use.

    - #### setPassword

          public static void setPassword(String password)

      Set global Password for decrypting certificates and keys.
      Parameters:
        `password` - Password to use.

    - #### generateRSATempKey

          @Deprecated
          public static boolean generateRSATempKey(int idx)

      Deprecated. Only useful in combination with EXPORT Cipher

    - #### loadDSATempKey

          @Deprecated
          public static boolean loadDSATempKey(int idx,
                                          String file)

      Deprecated. Now automatically loaded from certificate file

    - #### getLastError

          public static String getLastError()

      Return last SSL error string
      Returns:
        the error string

    - #### hasOp

          public static boolean hasOp(int op)

      Return true if all the requested SSL_OP_* are supported by OpenSSL. Note that for versions of tcnative < 1.1.25, this method will return `true` if and only if `op`= `SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION` and tcnative supports that flag.
      Parameters:
        `op` - Bitwise-OR of all SSL_OP_* to test.
      Returns:
        true if all SSL_OP_* are supported by OpenSSL library.

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.