Top Description Inners Fields Constructors Methods
org.conscrypt

public final Class NativeCrypto

extends Object
Class Inheritance
Annotations
@Internal
Imports
java.io.FileDescriptor, .IOException, .OutputStream, java.net.SocketTimeoutException, java.nio.Buffer, .ByteBuffer, java.security.InvalidAlgorithmParameterException, .InvalidKeyException, .MessageDigest, .NoSuchAlgorithmException, .PrivateKey, .SignatureException, java.security.cert.CertificateEncodingException, .CertificateException, .CertificateParsingException, java.util.ArrayList, .Arrays, .Calendar, .HashSet, .List, .Set, javax.crypto.BadPaddingException, .IllegalBlockSizeException, .ShortBufferException, javax.net.ssl.SSLException, javax.security.auth.x500.X500Principal, org.conscrypt.OpenSSLX509CertificateFactory.ParsingException

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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
pack-priv static interface
NativeCrypto.SSLHandshakeCallbacks

A collection of callbacks from the native OpenSSL code that are related to the SSL handshake initiated by SSL_do_handshake.

Field Summary

Modifier and TypeField and Description
pack-priv static final String[]
pack-priv static final String[]
DEFAULT_PSK_CIPHER_SUITES

TLS-PSK cipher suites enabled by default (if requested), in preference order.

pack-priv static final String[]
DEFAULT_X509_CIPHER_SUITES

X.509 based cipher suites enabled by default (if requested), in preference order.

pack-priv static final int
EXTENSION_TYPE_CRITICAL

Used to request only critical types in get_X509*_ext_oids.

pack-priv static final int
EXTENSION_TYPE_NON_CRITICAL

Used to request only non-critical types in get_X509*_ext_oids.

pack-priv static final int
GN_STACK_ISSUER_ALT_NAME

Used to request get_X509_GENERAL_NAME_stack get the issuerAlternativeName extension.

pack-priv static final int
GN_STACK_SUBJECT_ALT_NAME

Used to request get_X509_GENERAL_NAME_stack get the "altname" field.

private static final boolean
private static final UnsatisfiedLinkError
pack-priv static final String
pack-priv static final int
PKCS7_CERTS

Used as the "which" field in d2i_PKCS7_bio and PEM_read_bio_PKCS7.

pack-priv static final int
PKCS7_CRLS

Used as the "which" field in d2i_PKCS7_bio and PEM_read_bio_PKCS7.

private static final Set<String>
private static final String
private static final String
private static final String
pack-priv static final String
private static final String[]
private static final String[]
pack-priv static final Set<String>
pack-priv static final String[]
pack-priv static final Set<String>
pack-priv static final String
TLS_EMPTY_RENEGOTIATION_INFO_SCSV

TLS_EMPTY_RENEGOTIATION_INFO_SCSV is RFC 5746's renegotiation indication signaling cipher suite value.

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.

pack-priv static final String[]
TLSV11_PROTOCOLS

Protocols to enable by default when "TLSv1.1" is requested.

pack-priv static final String[]
TLSV12_PROTOCOLS

Protocols to enable by default when "TLSv1.2" is requested.

pack-priv static final String[]
TLSV13_PROTOCOLS

Protocols to enable by default when "TLSv1.3" is requested.

pack-priv static final String[]
TLSV1_PROTOCOLS

Protocols to enable by default when "TLSv1" is requested.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static native void
asn1_read_free(long cbsRef)

Frees any resources associated with the given reference.

pack-priv static native long
asn1_read_init(byte[] val)

Allocates and returns an opaque reference to an object that can be used with other asn1_read_* functions to read the ASN.1-encoded data in val.

pack-priv static native boolean
asn1_read_is_empty(long cbsRef)

Returns whether or not the given reference has been read completely.

pack-priv static native boolean
asn1_read_next_tag_is(long cbsRef, int tag)

Returns whether the next object in the given reference is explicitly tagged with the given tag number.

pack-priv static native void
asn1_read_null(long cbsRef)

Consumes an ASN.1 NULL from the given reference.

pack-priv static native byte[]
asn1_read_octetstring(long cbsRef)

Returns the contents of an ASN.1 octet string from the given reference.

pack-priv static native String
asn1_read_oid(long cbsRef)

Returns an ASN.1 OID in dotted-decimal notation (eg, "1.3.14.3.2.26" for SHA-1) from the given reference.

pack-priv static native long
asn1_read_sequence(long cbsRef)

Allocates and returns an opaque reference to an object that can be used with other asn1_read_* functions to read the ASN.1 sequence pointed to by cbsRef.

pack-priv static native long
asn1_read_tagged(long cbsRef)

Allocates and returns an opaque reference to an object that can be used with other asn1_read_* functions to read the ASN.1 data pointed to by cbsRef.

pack-priv static native long
asn1_read_uint64(long cbsRef)

Returns an ASN.1 integer from the given reference.

pack-priv static native byte[]
ASN1_seq_pack_X509(long[] x509CertRefs)

pack-priv static native long[]
pack-priv static native void
ASN1_TIME_to_Calendar(long asn1TimeCtx, Calendar cal)

pack-priv static native void
asn1_write_cleanup(long cbbRef)

Cleans up intermediate state in the given reference.

pack-priv static native byte[]
asn1_write_finish(long cbbRef)

Completes any in-progress operations and returns the ASN.1-encoded data.

pack-priv static native void
asn1_write_flush(long cbbRef)

Flushes the given reference, invalidating any child references and completing their operations.

pack-priv static native void
asn1_write_free(long cbbRef)

Frees resources associated with the given reference.

pack-priv static native long
asn1_write_init()

Allocates and returns an opaque reference to an object that can be used with other asn1_write_* functions to write ASN.1-encoded data.

pack-priv static native void
asn1_write_null(long cbbRef)

Writes a NULL value into the given reference.

pack-priv static native void
asn1_write_octetstring(long cbbRef, byte[] data)

Writes the given data into the given reference as an ASN.1-encoded octet string.

pack-priv static native void
asn1_write_oid(long cbbRef, String oid)

Writes the given OID (which must be in dotted-decimal notation) into the given reference.

pack-priv static native long
asn1_write_sequence(long cbbRef)

Allocates and returns an opaque reference to an object that can be used with other asn1_write_* functions to write an ASN.1 sequence into the given reference.

pack-priv static native long
asn1_write_tag(long cbbRef, int tag)

Allocates and returns an opaque reference to an object that can be used with other asn1_write_* functions to write a explicitly-tagged ASN.1 object with the given tag into the given reference.

pack-priv static native void
asn1_write_uint64(long cbbRef, long value)

Writes the given value into the given reference as an ASN.1-encoded integer.

pack-priv static native void
BIO_free_all(long bioRef)

pack-priv static native int
BIO_read(long bioRef, byte[] buffer)

Used for testing only.

pack-priv static native void
BIO_write(long bioRef, byte[] buffer, int offset, int length)

pack-priv static native void
chacha20_encrypt_decrypt(byte[] in, int inOffset, byte[] out, int outOffset, int length, byte[] key, byte[] nonce, int blockCounter)

Returns the encrypted or decrypted version of the data.

pack-priv static void
checkAvailability()

Checks to see whether or not the native library was successfully loaded.

pack-priv static String[]
pack-priv static String[]
pack-priv static String
cipherSuiteFromJava(String javaCipherSuite)

pack-priv static String
private static native void
pack-priv static native long
pack-priv static native long
pack-priv static native long[]
d2i_PKCS7_bio(long bioCtx, int which)

Returns an array of X509 or X509_CRL pointers.

pack-priv static native long
d2i_SSL_SESSION(byte[] data)

pack-priv static native long
d2i_X509(byte[] encoded)

pack-priv static native long
d2i_X509_bio(long bioCtx)

pack-priv static native long
d2i_X509_CRL_bio(long bioCtx)

pack-priv static native void
EC_GROUP_clear_free(long groupRef)

pack-priv static native byte[]
pack-priv static native byte[][]
pack-priv static native String
pack-priv static native int
pack-priv static native long
pack-priv static native byte[]
pack-priv static native long
EC_GROUP_new_arbitrary(byte[] p, byte[] a, byte[] b, byte[] x, byte[] y, byte[] order, int cofactor)

pack-priv static native long
pack-priv static native long
pack-priv static native long
pack-priv static native byte[]
pack-priv static native long
pack-priv static native byte[]
pack-priv static native long
EC_KEY_parse_curve_name(byte[] encoded)

pack-priv static native void
EC_POINT_clear_free(long pointRef)

pack-priv static native byte[][]
pack-priv static native long
pack-priv static native void
EC_POINT_set_affine_coordinates(NativeRef.EC_GROUP groupRef, NativeRef.EC_POINT pointRef, byte[] x, byte[] y)

pack-priv static native int
ECDH_compute_key(byte[] out, int outOffset, NativeRef.EVP_PKEY publicKeyRef, NativeRef.EVP_PKEY privateKeyRef)

pack-priv static native int
ECDSA_sign(byte[] data, byte[] sig, NativeRef.EVP_PKEY pkey)

pack-priv static native int
pack-priv static native int
ECDSA_verify(byte[] data, byte[] sig, NativeRef.EVP_PKEY pkey)

pack-priv static native int

Returns:

Returns the SSL error code for the operation when the error was SSL_ERROR_NONE, SSL_ERROR_WANT_READ, or SSL_ERROR_WANT_WRITE.
ENGINE_SSL_do_handshake
(long ssl, NativeSsl ssl_holder, NativeCrypto.SSLHandshakeCallbacks shc)

Variant of the SSL_do_handshake used by ConscryptEngine.

pack-priv static native void
ENGINE_SSL_force_read(long ssl, NativeSsl ssl_holder, NativeCrypto.SSLHandshakeCallbacks shc)

Forces the SSL object to process any data pending in the BIO.

pack-priv static native int
ENGINE_SSL_read_BIO_direct(long ssl, NativeSsl ssl_holder, long bioRef, long address, int len, NativeCrypto.SSLHandshakeCallbacks shc)

Reads data from the given BIO into a direct java.nio.ByteBuffer.

pack-priv static native int
ENGINE_SSL_read_BIO_heap(long ssl, NativeSsl ssl_holder, long bioRef, byte[] destJava, int destOffset, int destLength, NativeCrypto.SSLHandshakeCallbacks shc)

Reads data from the given BIO into an array.

pack-priv static native int

Returns:

if positive, represents the number of bytes read into the given buffer. Returns -SSL_ERROR_WANT_READ if more data is needed. Returns -SSL_ERROR_WANT_WRITE if data needs to be written out to flush the BIO.
ENGINE_SSL_read_direct
(long ssl, NativeSsl ssl_holder, long address, int length, NativeCrypto.SSLHandshakeCallbacks shc)

Variant of the SSL_read for a direct java.nio.ByteBuffer used by ConscryptEngine.

pack-priv static native void
pack-priv static native int
ENGINE_SSL_write_BIO_direct(long ssl, NativeSsl ssl_holder, long bioRef, long pos, int length, NativeCrypto.SSLHandshakeCallbacks shc)

Writes data from the given direct java.nio.ByteBuffer to the BIO.

pack-priv static native int
ENGINE_SSL_write_BIO_heap(long ssl, NativeSsl ssl_holder, long bioRef, byte[] sourceJava, int sourceOffset, int sourceLength, NativeCrypto.SSLHandshakeCallbacks shc)

Writes data from the given array to the BIO.

pack-priv static native int
ENGINE_SSL_write_direct(long ssl, NativeSsl ssl_holder, long address, int length, NativeCrypto.SSLHandshakeCallbacks shc)

Variant of the SSL_write for a direct java.nio.ByteBuffer used by ConscryptEngine.

pack-priv static native long
pack-priv static native long
pack-priv static native long
pack-priv static native long
pack-priv static native long
pack-priv static native int
EVP_AEAD_CTX_open(long evpAead, byte[] key, int tagLengthInBytes, byte[] out, int outOffset, byte[] nonce, byte[] in, int inOffset, int inLength, byte[] ad)

pack-priv static native int
EVP_AEAD_CTX_open_buf(long evpAead, byte[] key, int tagLengthInBytes, ByteBuffer out, byte[] nonce, ByteBuffer input, byte[] ad)

pack-priv static native int
EVP_AEAD_CTX_seal(long evpAead, byte[] key, int tagLengthInBytes, byte[] out, int outOffset, byte[] nonce, byte[] in, int inOffset, int inLength, byte[] ad)

pack-priv static native int
EVP_AEAD_CTX_seal_buf(long evpAead, byte[] key, int tagLengthInBytes, ByteBuffer out, byte[] nonce, ByteBuffer input, byte[] ad)

pack-priv static native int
EVP_AEAD_max_overhead(long evpAead)

pack-priv static native int
EVP_AEAD_nonce_length(long evpAead)

pack-priv static native int
pack-priv static native void
pack-priv static native long
pack-priv static native void
pack-priv static native void
pack-priv static native int
EVP_CIPHER_iv_length(long evpCipher)

pack-priv static native int
EVP_CipherFinal_ex(NativeRef.EVP_CIPHER_CTX ctx, byte[] out, int outOffset)

pack-priv static native void
EVP_CipherInit_ex(NativeRef.EVP_CIPHER_CTX ctx, long evpCipher, byte[] key, byte[] iv, boolean encrypting)

pack-priv static native int
EVP_CipherUpdate(NativeRef.EVP_CIPHER_CTX ctx, byte[] out, int outOffset, byte[] in, int inOffset, int inLength)

pack-priv static native int
EVP_DigestFinal_ex(NativeRef.EVP_MD_CTX ctx, byte[] hash, int offset)

pack-priv static native int
pack-priv static native byte[]
pack-priv static native long
pack-priv static native void
EVP_DigestSignUpdate(NativeRef.EVP_MD_CTX ctx, byte[] buffer, int offset, int length)

pack-priv static native void
EVP_DigestSignUpdateDirect(NativeRef.EVP_MD_CTX ctx, long ptr, int length)

pack-priv static native void
EVP_DigestUpdate(NativeRef.EVP_MD_CTX ctx, byte[] buffer, int offset, int length)

pack-priv static native void
EVP_DigestUpdateDirect(NativeRef.EVP_MD_CTX ctx, long ptr, int length)

pack-priv static native boolean
EVP_DigestVerifyFinal(NativeRef.EVP_MD_CTX ctx, byte[] signature, int offset, int length)

pack-priv static native long
pack-priv static native void
EVP_DigestVerifyUpdate(NativeRef.EVP_MD_CTX ctx, byte[] buffer, int offset, int length)

pack-priv static native void
pack-priv static native long
pack-priv static native long
pack-priv static native int
EVP_has_aes_hardware()

Returns 1 if the BoringSSL believes the CPU has AES accelerated hardware instructions.

pack-priv static native byte[]
pack-priv static native byte[]
pack-priv static native void
pack-priv static native int
pack-priv static native long
pack-priv static native void
pack-priv static native int
EVP_MD_size(long evp_md_const)

pack-priv static native long
EVP_parse_private_key(byte[] data)

pack-priv static native long
EVP_parse_public_key(byte[] data)

pack-priv static native int
pack-priv static native void
EVP_PKEY_CTX_free(long pkeyCtx)

pack-priv static native void
EVP_PKEY_CTX_set_rsa_mgf1_md(long ctx, long evpMdRef)

pack-priv static native void
EVP_PKEY_CTX_set_rsa_oaep_label(long ctx, byte[] label)

pack-priv static native void
EVP_PKEY_CTX_set_rsa_oaep_md(long ctx, long evpMdRef)

pack-priv static native void
EVP_PKEY_CTX_set_rsa_padding(long ctx, int pad)

pack-priv static native void
pack-priv static native int
EVP_PKEY_decrypt(NativeRef.EVP_PKEY_CTX ctx, byte[] out, int outOffset, byte[] input, int inOffset, int inLength)

pack-priv static native long
pack-priv static native int
EVP_PKEY_encrypt(NativeRef.EVP_PKEY_CTX ctx, byte[] out, int outOffset, byte[] input, int inOffset, int inLength)

pack-priv static native long
pack-priv static native void
EVP_PKEY_free(long pkey)

pack-priv static native long
EVP_PKEY_new_EC_KEY(NativeRef.EC_GROUP groupRef, NativeRef.EC_POINT pubkeyRef, byte[] privkey)

pack-priv static native long
EVP_PKEY_new_RSA(byte[] n, byte[] e, byte[] d, byte[] p, byte[] q, byte[] dmp1, byte[] dmq1, byte[] iqmp)

pack-priv static native String
pack-priv static native String
pack-priv static native int
pack-priv static native String[]
pack-priv static native int
pack-priv static native boolean
public static native byte[]
get_ocsp_single_extension(byte[] ocspResponse, String oid, long x509Ref, OpenSSLX509Certificate holder, long issuerX509Ref, OpenSSLX509Certificate holder2)

pack-priv static native byte[][]

Returns:

array of {n, e, d, p, q, dmp1, dmq1, iqmp}
get_RSA_private_params
(NativeRef.EVP_PKEY rsa)

pack-priv static native byte[][]

Returns:

array of {n, e}
get_RSA_public_params
(NativeRef.EVP_PKEY rsa)

pack-priv static native byte[]
pack-priv static native byte[]
get_X509_CRL_crl_enc(long x509CrlCtx, OpenSSLX509CRL holder)

pack-priv static native String[]
get_X509_CRL_ext_oids(long x509Crlctx, OpenSSLX509CRL holder, int critical)

pack-priv static native String
get_X509_CRL_sig_alg_oid(long x509CrlCtx, OpenSSLX509CRL holder)

pack-priv static native byte[]
pack-priv static native byte[]
get_X509_CRL_signature(long x509ctx, OpenSSLX509CRL holder)

pack-priv static native int
pack-priv static native boolean[]
pack-priv static native int
pack-priv static native String[]
pack-priv static native String[]
get_X509_ext_oids(long x509ctx, OpenSSLX509Certificate holder, int critical)

pack-priv static native Object[][]
get_X509_GENERAL_NAME_stack(long x509ctx, OpenSSLX509Certificate holder, int type)

pack-priv static native boolean[]
pack-priv static native String
pack-priv static native String[]
get_X509_REVOKED_ext_oids(long x509ctx, int critical)

pack-priv static native long
get_X509_REVOKED_revocationDate(long x509RevokedCtx)

Returns ASN1_TIME reference.

pack-priv static native String
pack-priv static native byte[]
pack-priv static native byte[]
pack-priv static native boolean[]
pack-priv static native byte[]
getApplicationProtocol(long ssl, NativeSsl ssl_holder)

Returns the selected ALPN protocol.

pack-priv static native long
getDirectBufferAddress(Buffer buf)

Returns the starting address of the memory region referenced by the provided direct Buffer or 0 if the provided buffer is not direct or if such access to direct buffers is not supported by the platform.

pack-priv static native long
private static int
private static NativeCrypto.Range
getProtocolRange(String[] protocols)

pack-priv static native long
getRSAPrivateKeyWrapper(PrivateKey key, byte[] modulus)

pack-priv static String[]
pack-priv static String[]
pack-priv static native void
HMAC_CTX_free(long ctx)

pack-priv static native long
pack-priv static native byte[]
pack-priv static native void
HMAC_Init_ex(NativeRef.HMAC_CTX ctx, byte[] key, long evp_md)

pack-priv static native void
HMAC_Update(NativeRef.HMAC_CTX ctx, byte[] in, int inOffset, int inLength)

pack-priv static native void
HMAC_UpdateDirect(NativeRef.HMAC_CTX ctx, long inPtr, int inLength)

pack-priv static native byte[]
i2d_PKCS7(long[] certs)

Returns an array of X509 or X509_CRL pointers.

pack-priv static native byte[]
i2d_SSL_SESSION(long sslSessionNativePointer)

pack-priv static native byte[]
i2d_X509(long x509ctx, OpenSSLX509Certificate holder)

pack-priv static native byte[]
i2d_X509_CRL(long x509CrlCtx, OpenSSLX509CRL holder)

pack-priv static native byte[]
i2d_X509_PUBKEY(long x509ctx, OpenSSLX509Certificate holder)

Takes an X509 context not an X509_PUBKEY context.

pack-priv static native byte[]
i2d_X509_REVOKED(long x509RevokedCtx)

pack-priv static native long[]
PEM_read_bio_PKCS7(long bioCtx, int which)

Returns an array of X509 or X509_CRL pointers.

pack-priv static native long
pack-priv static native long
PEM_read_bio_PUBKEY(long bioCtx)

pack-priv static native long
PEM_read_bio_X509(long bioCtx)

pack-priv static native long
PEM_read_bio_X509_CRL(long bioCtx)

pack-priv static native void
RAND_bytes(byte[] output)

pack-priv static native long
RSA_generate_key_ex(int modulusBits, byte[] publicExponent)

pack-priv static native int
RSA_private_decrypt(int flen, byte[] from, byte[] to, NativeRef.EVP_PKEY pkey, int padding)

pack-priv static native int
RSA_private_encrypt(int flen, byte[] from, byte[] to, NativeRef.EVP_PKEY pkey, int padding)

pack-priv static native int
RSA_public_decrypt(int flen, byte[] from, byte[] to, NativeRef.EVP_PKEY pkey, int padding)

pack-priv static native int
RSA_public_encrypt(int flen, byte[] from, byte[] to, NativeRef.EVP_PKEY pkey, int padding)

pack-priv static native int
pack-priv static native void
set_SSL_psk_client_callback_enabled(long ssl, NativeSsl ssl_holder, boolean enabled)

pack-priv static native void
set_SSL_psk_server_callback_enabled(long ssl, NativeSsl ssl_holder, boolean enabled)

pack-priv static native void
setApplicationProtocols(long ssl, NativeSsl ssl_holder, boolean client, byte[] protocols)

Enables ALPN for this TLS endpoint and sets the list of supported ALPN protocols in wire-format (length-prefixed 8-bit strings).

pack-priv static void
setEnabledCipherSuites(long ssl, NativeSsl ssl_holder, String[] cipherSuites, String[] protocols)

pack-priv static void
setEnabledProtocols(long ssl, NativeSsl ssl_holder, String[] protocols)

pack-priv static native void
setHasApplicationProtocolSelector(long ssl, NativeSsl ssl_holder, boolean hasSelector)

Called for a server endpoint only.

pack-priv static native void
setLocalCertsAndPrivateKey(long
the SSL reference.
ssl
,
NativeSsl ssl_holder, byte[][]
the encoded form of the local certificate chain.
encodedCertificates
,
NativeRef.EVP_PKEY
a reference to the private key.
pkey
)

Sets the local certificates and private key.

pack-priv static native void
SSL_accept_renegotiations(long ssl, NativeSsl ssl_holder)

pack-priv static native long
SSL_BIO_new(long ssl, NativeSsl ssl_holder)

pack-priv static native String
SSL_CIPHER_get_kx_name(long cipherAddress)

pack-priv static native void
pack-priv static native long
SSL_clear_mode(long ssl, NativeSsl ssl_holder, long mode)

pack-priv static native long
SSL_clear_options(long ssl, NativeSsl ssl_holder, long options)

pack-priv static native void
SSL_CTX_free(long ssl_ctx, AbstractSessionContext holder)

pack-priv static native long
pack-priv static native void
SSL_CTX_set_session_id_context(long ssl_ctx, AbstractSessionContext holder, byte[] sid_ctx)

pack-priv static native long
SSL_CTX_set_timeout(long ssl_ctx, AbstractSessionContext holder, long seconds)

pack-priv static native void
SSL_do_handshake(long ssl, NativeSsl ssl_holder, FileDescriptor fd, NativeCrypto.SSLHandshakeCallbacks shc, int timeoutMillis)

pack-priv static native void
SSL_enable_ocsp_stapling(long ssl, NativeSsl ssl_holder)

pack-priv static native void
pack-priv static native void
SSL_enable_tls_channel_id(long ssl, NativeSsl ssl_holder)

pack-priv static native byte[]
SSL_export_keying_material(long ssl, NativeSsl ssl_holder, byte[] label, byte[] context, int num_bytes)

pack-priv static native void
SSL_free(long ssl, NativeSsl ssl_holder)

pack-priv static native byte[][]
SSL_get0_peer_certificates(long ssl, NativeSsl ssl_holder)

Returns the peer certificate chain.

pack-priv static native long
SSL_get1_session(long ssl, NativeSsl ssl_holder)

pack-priv static native long[]

Returns:

array of SSL_CIPHER references.
SSL_get_ciphers
(long ssl, NativeSsl ssl_holder)

Gets the list of cipher suites enabled for the provided SSL instance.

public static native String
SSL_get_current_cipher(long ssl, NativeSsl ssl_holder)

pack-priv static native int
SSL_get_error(long ssl, NativeSsl ssl_holder, int ret)

pack-priv static native long
SSL_get_mode(long ssl, NativeSsl ssl_holder)

pack-priv static native byte[]
SSL_get_ocsp_response(long ssl, NativeSsl ssl_holder)

pack-priv static native long
SSL_get_options(long ssl, NativeSsl ssl_holder)

pack-priv static native String
SSL_get_servername(long ssl, NativeSsl ssl_holder)

pack-priv static native int
SSL_get_shutdown(long ssl, NativeSsl ssl_holder)

pack-priv static native int
pack-priv static native byte[]
pack-priv static native long
SSL_get_time(long ssl, NativeSsl ssl_holder)

pack-priv static native long
SSL_get_timeout(long ssl, NativeSsl ssl_holder)

pack-priv static native byte[]
SSL_get_tls_channel_id(long ssl, NativeSsl ssl_holder)

pack-priv static native byte[]
SSL_get_tls_unique(long ssl, NativeSsl ssl_holder)

public static native String
SSL_get_version(long ssl, NativeSsl ssl_holder)

pack-priv static native void
SSL_interrupt(long ssl, NativeSsl ssl_holder)

pack-priv static native int
SSL_max_seal_overhead(long ssl, NativeSsl ssl_holder)

Returns the maximum overhead, in bytes, of sealing a record with SSL.

pack-priv static native long
SSL_new(long ssl_ctx, AbstractSessionContext holder)

pack-priv static native int
SSL_pending_readable_bytes(long ssl, NativeSsl ssl_holder)

pack-priv static native int
pack-priv static native int

Returns:

-1 if error or the end of the stream is reached.
SSL_read
(long ssl, NativeSsl ssl_holder, FileDescriptor fd, NativeCrypto.SSLHandshakeCallbacks shc, byte[] b, int off, int len, int readTimeoutMillis)

Reads with the native SSL_read function from the encrypted data stream

pack-priv static native String
SSL_SESSION_cipher(long sslSessionNativePointer)

pack-priv static native void
SSL_SESSION_free(long sslSessionNativePointer)

pack-priv static native long
SSL_SESSION_get_time(long sslSessionNativePointer)

pack-priv static native long
SSL_SESSION_get_timeout(long sslSessionNativePointer)

pack-priv static native String
SSL_SESSION_get_version(long sslSessionNativePointer)

pack-priv static native byte[]
SSL_session_id(long ssl, NativeSsl ssl_holder)

pack-priv static native boolean
SSL_session_reused(long ssl, NativeSsl ssl_holder)

pack-priv static native byte[]
SSL_SESSION_session_id(long sslSessionNativePointer)

pack-priv static native boolean
SSL_SESSION_should_be_single_use(long sslSessionNativePointer)

pack-priv static native void
SSL_SESSION_up_ref(long sslSessionNativePointer)

pack-priv static native void
pack-priv static native void
SSL_set_accept_state(long ssl, NativeSsl ssl_holder)

pack-priv static native void
SSL_set_cipher_lists(long ssl, NativeSsl ssl_holder, String[] ciphers)

pack-priv static native void
SSL_set_client_CA_list(long ssl, NativeSsl ssl_holder, byte[][] asn1DerEncodedX500Principals)

pack-priv static native void
SSL_set_connect_state(long ssl, NativeSsl ssl_holder)

pack-priv static native long
SSL_set_mode(long ssl, NativeSsl ssl_holder, long mode)

pack-priv static native void
SSL_set_ocsp_response(long ssl, NativeSsl ssl_holder, byte[] response)

pack-priv static native long
SSL_set_options(long ssl, NativeSsl ssl_holder, long options)

pack-priv static native int
SSL_set_protocol_versions(long ssl, NativeSsl ssl_holder, int min_version, int max_version)

pack-priv static native void
SSL_set_session(long ssl, NativeSsl ssl_holder, long sslSessionNativePointer)

pack-priv static native void
SSL_set_session_creation_enabled(long ssl, NativeSsl ssl_holder, boolean creationEnabled)

pack-priv static native void
SSL_set_signed_cert_timestamp_list(long ssl, NativeSsl ssl_holder, byte[] list)

pack-priv static native long
SSL_set_timeout(long ssl, NativeSsl ssl_holder, long millis)

pack-priv static native void
SSL_set_tlsext_host_name(long ssl, NativeSsl ssl_holder, String hostname)

pack-priv static native void
SSL_set_verify(long ssl, NativeSsl ssl_holder, int mode)

pack-priv static native void
pack-priv static native void
SSL_use_psk_identity_hint(long ssl, NativeSsl ssl_holder, String identityHint)

pack-priv static native void
SSL_write(long ssl, NativeSsl ssl_holder, FileDescriptor fd, NativeCrypto.SSLHandshakeCallbacks shc, byte[] b, int off, int len, int writeTimeoutMillis)

Writes with the native SSL_write function to the encrypted data stream.

pack-priv static native int
X509_check_issued(long ctx, OpenSSLX509Certificate holder, long ctx2, OpenSSLX509Certificate holder2)

pack-priv static native int
X509_cmp(long x509ctx1, OpenSSLX509Certificate holder, long x509ctx2, OpenSSLX509Certificate holder2)

pack-priv static native void
X509_CRL_free(long x509CrlCtx, OpenSSLX509CRL holder)

pack-priv static native long
X509_CRL_get0_by_cert(long x509CrlCtx, OpenSSLX509CRL holder, long x509Ctx, OpenSSLX509Certificate holder2)

Returns X509_REVOKED reference that is not duplicated!

pack-priv static native long
X509_CRL_get0_by_serial(long x509CrlCtx, OpenSSLX509CRL holder, byte[] serial)

Returns X509_REVOKED reference that is not duplicated!

pack-priv static native long
X509_CRL_get_ext(long x509CrlCtx, OpenSSLX509CRL holder, String oid)

pack-priv static native byte[]
X509_CRL_get_ext_oid(long x509CrlCtx, OpenSSLX509CRL holder, String oid)

pack-priv static native byte[]
X509_CRL_get_issuer_name(long x509CrlCtx, OpenSSLX509CRL holder)

pack-priv static native long
X509_CRL_get_lastUpdate(long x509CrlCtx, OpenSSLX509CRL holder)

pack-priv static native long
X509_CRL_get_nextUpdate(long x509CrlCtx, OpenSSLX509CRL holder)

pack-priv static native long[]
X509_CRL_get_REVOKED(long x509CrlCtx, OpenSSLX509CRL holder)

Returns an array of X509_REVOKED that are owned by the caller.

pack-priv static native long
X509_CRL_get_version(long x509CrlCtx, OpenSSLX509CRL holder)

pack-priv static native void
X509_CRL_print(long bioCtx, long x509CrlCtx, OpenSSLX509CRL holder)

pack-priv static native void
X509_CRL_verify(long x509CrlCtx, OpenSSLX509CRL holder, NativeRef.EVP_PKEY pkeyCtx)

pack-priv static native void
pack-priv static native long
X509_dup(long x509ctx, OpenSSLX509Certificate holder)

pack-priv static native void
X509_free(long x509ctx, OpenSSLX509Certificate holder)

pack-priv static native byte[]
X509_get_ext_oid(long x509ctx, OpenSSLX509Certificate holder, String oid)

pack-priv static native byte[]
pack-priv static native long
pack-priv static native long
pack-priv static native long
pack-priv static native byte[]
pack-priv static native byte[]
pack-priv static native long
pack-priv static int
private static int
X509_NAME_hash(X500Principal principal, String algorithm)

public static int
pack-priv static native void
X509_print_ex(long bioCtx, long x509ctx, OpenSSLX509Certificate holder, long nmflag, long certflag)

pack-priv static native long
X509_REVOKED_dup(long x509RevokedCtx)

pack-priv static native long
X509_REVOKED_get_ext(long x509RevokedCtx, String oid)

pack-priv static native byte[]
X509_REVOKED_get_ext_oid(long x509RevokedCtx, String oid)

pack-priv static native byte[]
X509_REVOKED_get_serialNumber(long x509RevokedCtx)

pack-priv static native void
X509_REVOKED_print(long bioRef, long x509RevokedCtx)

pack-priv static native int
X509_supported_extension(long x509ExtensionRef)

pack-priv static native void
X509_verify(long x509ctx, OpenSSLX509Certificate holder, NativeRef.EVP_PKEY pkeyCtx)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait