Package org.conscrypt

Class NativeCrypto

java.lang.Object
org.conscrypt.NativeCrypto

@Internal public final class NativeCrypto extends Object
Provides the Java side of our JNI glue for OpenSSL.

Note: Many methods in this class take a reference to a Java object that holds a native pointer in the form of a long in addition to the long itself and don't use the Java object in the native implementation. This is to prevent the Java object from becoming eligible for GC while the native method is executing. See this for more details.

  • Field Details

    • loadError

      private static final UnsatisfiedLinkError loadError
    • GN_STACK_SUBJECT_ALT_NAME

      static final int GN_STACK_SUBJECT_ALT_NAME
      Used to request get_X509_GENERAL_NAME_stack get the "altname" field.
      See Also:
    • GN_STACK_ISSUER_ALT_NAME

      static final int GN_STACK_ISSUER_ALT_NAME
      Used to request get_X509_GENERAL_NAME_stack get the issuerAlternativeName extension.
      See Also:
    • EXTENSION_TYPE_NON_CRITICAL

      static final int EXTENSION_TYPE_NON_CRITICAL
      Used to request only non-critical types in get_X509*_ext_oids.
      See Also:
    • EXTENSION_TYPE_CRITICAL

      static final int EXTENSION_TYPE_CRITICAL
      Used to request only critical types in get_X509*_ext_oids.
      See Also:
    • PKCS7_CERTS

      static final int PKCS7_CERTS
      Used as the "which" field in d2i_PKCS7_bio and PEM_read_bio_PKCS7.
      See Also:
    • PKCS7_CRLS

      static final int PKCS7_CRLS
      Used as the "which" field in d2i_PKCS7_bio and PEM_read_bio_PKCS7.
      See Also:
    • OBSOLETE_PROTOCOL_SSLV3

      static final String OBSOLETE_PROTOCOL_SSLV3
      See Also:
    • SUPPORTED_PROTOCOL_TLSV1

      private static final String SUPPORTED_PROTOCOL_TLSV1
      See Also:
    • SUPPORTED_PROTOCOL_TLSV1_1

      private static final String SUPPORTED_PROTOCOL_TLSV1_1
      See Also:
    • SUPPORTED_PROTOCOL_TLSV1_2

      private static final String SUPPORTED_PROTOCOL_TLSV1_2
      See Also:
    • SUPPORTED_PROTOCOL_TLSV1_3

      static final String SUPPORTED_PROTOCOL_TLSV1_3
      See Also:
    • SUPPORTED_TLS_1_3_CIPHER_SUITES

      static final String[] SUPPORTED_TLS_1_3_CIPHER_SUITES
    • SUPPORTED_TLS_1_2_CIPHER_SUITES_SET

      static final Set<String> SUPPORTED_TLS_1_2_CIPHER_SUITES_SET
    • SUPPORTED_LEGACY_CIPHER_SUITES_SET

      private static final Set<String> SUPPORTED_LEGACY_CIPHER_SUITES_SET
    • SUPPORTED_TLS_1_3_CIPHER_SUITES_SET

      static final Set<String> SUPPORTED_TLS_1_3_CIPHER_SUITES_SET
    • TLS_EMPTY_RENEGOTIATION_INFO_SCSV

      static final String TLS_EMPTY_RENEGOTIATION_INFO_SCSV
      TLS_EMPTY_RENEGOTIATION_INFO_SCSV is RFC 5746's renegotiation indication signaling cipher suite value. It is not a real cipher suite. It is just an indication in the default and supported cipher suite lists indicates that the implementation supports secure renegotiation.

      In the RI, its presence means that the SCSV is sent in the cipher suite list to indicate secure renegotiation support and its absense means to send an empty TLS renegotiation info extension instead.

      However, OpenSSL doesn't provide an API to give this level of control, instead always sending the SCSV and always including the empty renegotiation info if TLS is used (as opposed to SSL). So we simply allow TLS_EMPTY_RENEGOTIATION_INFO_SCSV to be passed for compatibility as to provide the hint that we support secure renegotiation.

      See Also:
    • TLS_FALLBACK_SCSV

      private static final String TLS_FALLBACK_SCSV
      TLS_FALLBACK_SCSV is from https://tools.ietf.org/html/draft-ietf-tls-downgrade-scsv-00 to indicate to the server that this is a fallback protocol request.
      See Also:
    • HAS_AES_HARDWARE

      private static final boolean HAS_AES_HARDWARE
    • SUPPORTED_TLS_1_2_CIPHER_SUITES

      private static final String[] SUPPORTED_TLS_1_2_CIPHER_SUITES
    • DEFAULT_X509_CIPHER_SUITES

      static final String[] DEFAULT_X509_CIPHER_SUITES
      X.509 based cipher suites enabled by default (if requested), in preference order.
    • DEFAULT_PSK_CIPHER_SUITES

      static final String[] DEFAULT_PSK_CIPHER_SUITES
      TLS-PSK cipher suites enabled by default (if requested), in preference order.
    • TLSV13_PROTOCOLS

      static final String[] TLSV13_PROTOCOLS
      Protocols to enable by default when "TLSv1.3" is requested.
    • TLSV12_PROTOCOLS

      static final String[] TLSV12_PROTOCOLS
      Protocols to enable by default when "TLSv1.2" is requested.
    • TLSV11_PROTOCOLS

      static final String[] TLSV11_PROTOCOLS
      Protocols to enable by default when "TLSv1.1" is requested.
    • TLSV1_PROTOCOLS

      static final String[] TLSV1_PROTOCOLS
      Protocols to enable by default when "TLSv1" is requested.
    • DEFAULT_PROTOCOLS

      static final String[] DEFAULT_PROTOCOLS
    • SUPPORTED_PROTOCOLS

      private static final String[] SUPPORTED_PROTOCOLS
  • Constructor Details

    • NativeCrypto

      public NativeCrypto()
  • Method Details