Module Core

module Core: sig .. end

Core type definitions


type tls_version = 
| TLS_1_0
| TLS_1_1
| TLS_1_2
val tls_version_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> tls_version
val sexp_of_tls_version : tls_version -> Ppx_sexp_conv_lib.Sexp.t
val pair_of_tls_version : tls_version -> int * int
val tls_version_of_pair : int * int -> tls_version option
type tls_any_version = 
| SSL_3
| Supported of tls_version
| TLS_1_X of int
val tls_any_version_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> tls_any_version
val sexp_of_tls_any_version : tls_any_version -> Ppx_sexp_conv_lib.Sexp.t
val any_version_to_version : tls_any_version -> tls_version option
val version_eq : tls_any_version -> tls_version -> bool
val version_ge : tls_any_version -> tls_version -> bool
val tls_any_version_of_pair : int * int -> tls_any_version option
val pair_of_tls_any_version : tls_any_version -> int * int
val max_protocol_version : 'a * 'b -> 'b
val min_protocol_version : 'a * 'b -> 'a
type tls_hdr = {
   content_type : Packet.content_type;
   version : tls_any_version;
}
val tls_hdr_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> tls_hdr
val sexp_of_tls_hdr : tls_hdr -> Ppx_sexp_conv_lib.Sexp.t
module SessionID: sig .. end
type client_extension = [ `ALPN of string list
| `ECPointFormats of Packet.ec_point_format list
| `EllipticCurves of Packet.named_curve_type list
| `ExtendedMasterSecret
| `Hostname of string
| `MaxFragmentLength of Packet.max_fragment_length
| `Padding of int
| `SecureRenegotiation of Cstruct_sexp.t
| `SignatureAlgorithms of
(Nocrypto.Hash.hash * Packet.signature_algorithm_type) list
| `UnknownExtension of int * Cstruct_sexp.t ]
val __client_extension_of_sexp__ : Ppx_sexp_conv_lib.Sexp.t -> client_extension
val client_extension_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> client_extension
val sexp_of_client_extension : client_extension -> Ppx_sexp_conv_lib.Sexp.t
type server_extension = [ `ALPN of string
| `ECPointFormats of Packet.ec_point_format list
| `ExtendedMasterSecret
| `Hostname
| `MaxFragmentLength of Packet.max_fragment_length
| `SecureRenegotiation of Cstruct_sexp.t
| `UnknownExtension of int * Cstruct_sexp.t ]
val __server_extension_of_sexp__ : Ppx_sexp_conv_lib.Sexp.t -> server_extension
val server_extension_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> server_extension
val sexp_of_server_extension : server_extension -> Ppx_sexp_conv_lib.Sexp.t
type client_hello = {
   client_version : tls_any_version;
   client_random : Cstruct_sexp.t;
   sessionid : SessionID.t option;
   ciphersuites : Packet.any_ciphersuite list;
   extensions : client_extension list;
}
val client_hello_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> client_hello
val sexp_of_client_hello : client_hello -> Ppx_sexp_conv_lib.Sexp.t
type server_hello = {
   server_version : tls_version;
   server_random : Cstruct_sexp.t;
   sessionid : SessionID.t option;
   ciphersuite : Ciphersuite.ciphersuite;
   extensions : server_extension list;
}
val server_hello_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> server_hello
val sexp_of_server_hello : server_hello -> Ppx_sexp_conv_lib.Sexp.t
type dh_parameters = {
   dh_p : Cstruct_sexp.t;
   dh_g : Cstruct_sexp.t;
   dh_Ys : Cstruct_sexp.t;
}
val dh_parameters_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> dh_parameters
val sexp_of_dh_parameters : dh_parameters -> Ppx_sexp_conv_lib.Sexp.t
type ec_curve = {
   a : Cstruct_sexp.t;
   b : Cstruct_sexp.t;
}
val ec_curve_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> ec_curve
val sexp_of_ec_curve : ec_curve -> Ppx_sexp_conv_lib.Sexp.t
type ec_prime_parameters = {
   prime : Cstruct_sexp.t;
   curve : ec_curve;
   base : Cstruct_sexp.t;
   order : Cstruct_sexp.t;
   cofactor : Cstruct_sexp.t;
   public : Cstruct_sexp.t;
}
val ec_prime_parameters_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> ec_prime_parameters
val sexp_of_ec_prime_parameters : ec_prime_parameters -> Ppx_sexp_conv_lib.Sexp.t
type ec_char_parameters = {
   m : int;
   basis : Packet.ec_basis_type;
   ks : Cstruct_sexp.t list;
   curve : ec_curve;
   base : Cstruct_sexp.t;
   order : Cstruct_sexp.t;
   cofactor : Cstruct_sexp.t;
   public : Cstruct_sexp.t;
}
val ec_char_parameters_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> ec_char_parameters
val sexp_of_ec_char_parameters : ec_char_parameters -> Ppx_sexp_conv_lib.Sexp.t
type ec_parameters = 
| ExplicitPrimeParameters of ec_prime_parameters
| ExplicitCharParameters of ec_char_parameters
| NamedCurveParameters of (Packet.named_curve_type * Cstruct_sexp.t)
val ec_parameters_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> ec_parameters
val sexp_of_ec_parameters : ec_parameters -> Ppx_sexp_conv_lib.Sexp.t
type tls_handshake = 
| HelloRequest
| ServerHelloDone
| ClientHello of client_hello
| ServerHello of server_hello
| Certificate of Cstruct_sexp.t list
| ServerKeyExchange of Cstruct_sexp.t
| CertificateRequest of Cstruct_sexp.t
| ClientKeyExchange of Cstruct_sexp.t
| CertificateVerify of Cstruct_sexp.t
| Finished of Cstruct_sexp.t
val tls_handshake_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> tls_handshake
val sexp_of_tls_handshake : tls_handshake -> Ppx_sexp_conv_lib.Sexp.t
type tls_alert = Packet.alert_level * Packet.alert_type 
val tls_alert_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> tls_alert
val sexp_of_tls_alert : tls_alert -> Ppx_sexp_conv_lib.Sexp.t
type tls_body = 
| TLS_ChangeCipherSpec
| TLS_ApplicationData
| TLS_Alert of tls_alert
| TLS_Handshake of tls_handshake
val tls_body_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> tls_body
val sexp_of_tls_body : tls_body -> Ppx_sexp_conv_lib.Sexp.t
type master_secret = Cstruct_sexp.t 

the master secret of a TLS connection

val master_secret_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> master_secret
val sexp_of_master_secret : master_secret -> Ppx_sexp_conv_lib.Sexp.t
module Cert: sig .. end
type epoch_data = {
   protocol_version : tls_version;
   ciphersuite : Ciphersuite.ciphersuite;
   peer_random : Cstruct_sexp.t;
   peer_certificate_chain : Cert.t list;
   peer_certificate : Cert.t option;
   peer_name : string option;
   trust_anchor : Cert.t option;
   received_certificates : Cert.t list;
   own_random : Cstruct_sexp.t;
   own_certificate : Cert.t list;
   own_private_key : Nocrypto.Rsa.priv option;
   own_name : string option;
   master_secret : master_secret;
   session_id : SessionID.t;
   extended_ms : bool;
   alpn_protocol : string option;
}

information about an open session

val epoch_data_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> epoch_data
val sexp_of_epoch_data : epoch_data -> Ppx_sexp_conv_lib.Sexp.t
val supports_key_usage : ?not_present:bool -> X509.Certificate.t -> X509.Extension.key_usage -> bool
val supports_extended_key_usage : ?not_present:bool ->
X509.Certificate.t -> X509.Extension.extended_key_usage -> bool