ocean.net.ssl.openssl.OpenSsl

C binding to OpenSSL v1.0.x

The OpenSSL library is very large. This binding includes only a tiny fraction of the available functions.

Members

Enums

SSL_ERROR_NONE
anonymousenum SSL_ERROR_NONE

SSL error codes

SSL_OP_ALL
anonymousenum SSL_OP_ALL

Options used by SSL_CTX_set_options

SSL_VERIFY_NONE
anonymousenum SSL_VERIFY_NONE

Enum used by SSL_CTX_set_verify

Functions

ERR_clear_error
void ERR_clear_error()

Empties the current thread's error queue.

ERR_get_error
c_ulong ERR_get_error()

Returns the earliest error code from the thread's error queue and removes the entry. This function can be called repeatedly until there are no more error codes to return.

ERR_reason_error_string
const(char*) ERR_reason_error_string(c_ulong e)

Obtains a human-readable error message

EVP_DigestSignFinal
int EVP_DigestSignFinal(EVP_MD_CTX* ctx, const(void)* signature, size_t* sig_len)

Generates a signature for the data in the message digest context

EVP_DigestSignInit
int EVP_DigestSignInit(EVP_MD_CTX* ctx, EVP_PKEY_CTX** pctx, const(EVP_MD)* type, ENGINE* e, EVP_PKEY* pkey)

Sets up the digest context for generating a signature

EVP_DigestUpdate
int EVP_DigestUpdate(EVP_MD_CTX* ctx, const(void)* d, size_t cnt)

Hashes data into a digest context, to update a signature

EVP_MD_CTX_create
EVP_MD_CTX* EVP_MD_CTX_create()

Allocates, initializes and returns a message digest context.

EVP_MD_CTX_destroy
void EVP_MD_CTX_destroy(EVP_MD_CTX* ctx)

Cleans up digest context ctx and frees up the space allocated to it. Should be called only on a context created using EVP_MD_CTX_create().

EVP_PKEY_free
void EVP_PKEY_free(EVP_PKEY* key)

Frees an EVP_PKEY structure

EVP_PKEY_new
EVP_PKEY* EVP_PKEY_new()

Allocates an empty EVP_PKEY structure, which is used to store public and private keys

EVP_PKEY_set1_RSA
int EVP_PKEY_set1_RSA(EVP_PKEY* pkey, RSA* rsa)

Sets the key referenced by pkey to rsa

EVP_sha256
const(EVP_MD)* EVP_sha256()

Returns an EVP_MD structure for the SHA256 digest algorithm

RSA_free
void RSA_free(RSA* rsa)

Frees an RSA structure

RSA_new
RSA* RSA_new()

Allocates and initializes an RSA structure

SSL_CTX_free
void SSL_CTX_free(SSL_CTX* ctx)

Frees memory and resources associated with the SSL_CTX object.

SSL_CTX_load_verify_locations
int SSL_CTX_load_verify_locations(SSL_CTX* ctx, const(char*) CAfile, const(char*) CApath)

Specifies the locations for ctx, at which CA certificates for verification purposes are located. The certificates available via CAfile and CApath are trusted.

SSL_CTX_new
SSL_CTX* SSL_CTX_new(const(ssl_method_st)* meth)

Creates a new SSL_CTX object as framework to establish TLS/SSL or DTLS enabled connections.

SSL_CTX_set_options
c_long SSL_CTX_set_options(SSL_CTX* ctx, c_long op)

Adds the options to the SSL context. Options already set before are not cleared.

SSL_CTX_set_verify
void SSL_CTX_set_verify(SSL_CTX* ctx, int mode, int function(int, X509_STORE_CTX*) callback)

Sets the verification parameters for an SSL context

SSL_CTX_set_verify_depth
void SSL_CTX_set_verify_depth(SSL_CTX* ctx, int depth)

Sets the maxiumum depth for certificate chain verification

SSL_do_handshake
int SSL_do_handshake(SSL* ssl)

Start an SSL handshake

SSL_get_error
int SSL_get_error(const(SSL)* ssl, int ret)

Obtains the result code for a TLS/SSL I/O operation.

SSL_get_peer_certificate
X509* SSL_get_peer_certificate(const(SSL)* s)

Gets the X509 certificate of the peer

SSL_get_verify_result
c_long SSL_get_verify_result(const(SSL)* ssl)

Get the result of peer certficate verification

SSL_library_init
int SSL_library_init()

Initialize the SSL library by registering algorithms

SSL_load_error_strings
void SSL_load_error_strings()

Registers the error strings for all libcrypto and libssl function

SSL_new
SSL* SSL_new(SSL_CTX* ctx)

Creates a new SSL object for a connection.

SSL_read
int SSL_read(SSL* ssl, void* buf, int num)

Read bytes from an SSL connection

SSL_set_accept_state
void SSL_set_accept_state(SSL* ssl)

Sets the SSL object to work in server mode

SSL_set_cipher_list
int SSL_set_cipher_list(SSL* ssl, const(char*) str)

Sets the list of available ciphers

SSL_set_connect_state
void SSL_set_connect_state(SSL* ssl)

Sets the SSL object to work in client mode

SSL_set_fd
int SSL_set_fd(SSL* ssl, int fd)

Sets the file descriptor for the SSL object

SSL_write
int SSL_write(SSL* ssl, const(void*) buf, int num)

Writes bytes to an SSL connection

SSLv23_method
ssl_method_st* SSLv23_method()

Retrieve the function pointers for SSLv3, or v2 if v3 is unavailable

X509_free
void X509_free(X509* a)

Frees an X509 structure

X509_new
X509* X509_new()

Allocates and initializes an X509 structure

decodeRSAPrivateKey
RSA* decodeRSAPrivateKey(const(void)[] key)

Decodes a PKCS#1 RSAPrivateKey structure, creating an RSA object

Structs

ENGINE
struct ENGINE

Opaque struct which holds a digest encryption engine

EVP_MD
struct EVP_MD

Opaque struct which holds a message digest

EVP_MD_CTX
struct EVP_MD_CTX

Opaque struct which holds a message digest context

EVP_PKEY
struct EVP_PKEY

Opaque struct which holds a private key

EVP_PKEY_CTX
struct EVP_PKEY_CTX

Opaque struct which holds a private key context

RSA
struct RSA

Opaque struct which holds RSA encryption parameters

SSL
struct SSL

Opaque struct which implements an SSL connection

SSL_CTX
struct SSL_CTX

Opaque struct which implements an SSL connection context

X509
struct X509

Opaque struct which implements an X509 certificate

X509_STORE_CTX
struct X509_STORE_CTX

The context used wile verifying an X509 certificate

ssl_method_st
struct ssl_method_st

Opaque struct which contains function pointers for SSLv2 or SSLv3/TLSv1 functions. This is roughly equivalent to a virtual function table, but implemented in plain C.

Meta