package tls

  1. Overview
  2. Docs

Core type definitions

type tls13 = [
  1. | `TLS_1_3
]
val __tls13_of_sexp__ : Sexplib0.Sexp.t -> tls13
val tls13_of_sexp : Sexplib0.Sexp.t -> tls13
val sexp_of_tls13 : tls13 -> Sexplib0.Sexp.t
type tls_before_13 = [
  1. | `TLS_1_0
  2. | `TLS_1_1
  3. | `TLS_1_2
]
val __tls_before_13_of_sexp__ : Sexplib0.Sexp.t -> tls_before_13
val tls_before_13_of_sexp : Sexplib0.Sexp.t -> tls_before_13
val sexp_of_tls_before_13 : tls_before_13 -> Sexplib0.Sexp.t
type tls_version = [
  1. | tls13
  2. | tls_before_13
]
val __tls_version_of_sexp__ : Sexplib0.Sexp.t -> tls_version
val tls_version_of_sexp : Sexplib0.Sexp.t -> tls_version
val sexp_of_tls_version : tls_version -> Sexplib0.Sexp.t
val pair_of_tls_version : [< `TLS_1_0 | `TLS_1_1 | `TLS_1_2 | `TLS_1_3 ] -> int * int
val compare_tls_version : [< `TLS_1_0 | `TLS_1_1 | `TLS_1_2 | `TLS_1_3 ] -> [< `TLS_1_0 | `TLS_1_1 | `TLS_1_2 | `TLS_1_3 ] -> int
val next : [< `TLS_1_0 | `TLS_1_1 | `TLS_1_2 | `TLS_1_3 ] -> [> `TLS_1_1 | `TLS_1_2 | `TLS_1_3 ] option
val all_versions : ([< `TLS_1_0 | `TLS_1_1 | `TLS_1_2 | `TLS_1_3 TLS_1_1 TLS_1_2 TLS_1_3 ] as 'a * [< `TLS_1_0 | `TLS_1_1 | `TLS_1_2 | `TLS_1_3 ]) -> 'a list
val tls_version_of_pair : (int * int) -> [> `TLS_1_0 | `TLS_1_1 | `TLS_1_2 | `TLS_1_3 ] option
type tls_any_version = [
  1. | tls_version
  2. | `SSL_3
  3. | `TLS_1_X of int
]
val __tls_any_version_of_sexp__ : Sexplib0.Sexp.t -> tls_any_version
val tls_any_version_of_sexp : Sexplib0.Sexp.t -> tls_any_version
val sexp_of_tls_any_version : tls_any_version -> Sexplib0.Sexp.t
val any_version_to_version : [> tls_version ] -> [> `TLS_1_0 | `TLS_1_1 | `TLS_1_2 | `TLS_1_3 ] option
val version_eq : [> tls_version ] -> [< `TLS_1_0 | `TLS_1_1 | `TLS_1_2 | `TLS_1_3 ] -> bool
val version_ge : [< `SSL_3 | `TLS_1_0 | `TLS_1_1 | `TLS_1_2 | `TLS_1_3 | `TLS_1_X of 'a ] -> [< `TLS_1_0 | `TLS_1_1 | `TLS_1_2 | `TLS_1_3 ] -> bool
val tls_any_version_of_pair : (int * int) -> [> `SSL_3 | `TLS_1_0 | `TLS_1_1 | `TLS_1_2 | `TLS_1_3 | `TLS_1_X of int ] option
val pair_of_tls_any_version : [< `SSL_3 | `TLS_1_0 | `TLS_1_1 | `TLS_1_2 | `TLS_1_3 | `TLS_1_X of int ] -> int * int
val max_protocol_version : ('a * 'b) -> 'b
val min_protocol_version : ('a * 'b) -> 'a
type tls_hdr = {
  1. content_type : Packet.content_type;
  2. version : tls_any_version;
}
val tls_hdr_of_sexp : Sexplib0.Sexp.t -> tls_hdr
val sexp_of_tls_hdr : tls_hdr -> Sexplib0.Sexp.t
module SessionID : sig ... end
module PreSharedKeyID : sig ... end
type psk_identity = (Cstruct_sexp.t * int32) * Cstruct_sexp.t
val psk_identity_of_sexp : Sexplib0.Sexp.t -> psk_identity
val sexp_of_psk_identity : psk_identity -> Sexplib0.Sexp.t
val binders_len : ('a * Cstruct.t) list -> int
type group = [
  1. | `FFDHE2048
  2. | `FFDHE3072
  3. | `FFDHE4096
  4. | `FFDHE6144
  5. | `FFDHE8192
  6. | `X25519
  7. | `P256
]
val __group_of_sexp__ : Sexplib0.Sexp.t -> group
val group_of_sexp : Sexplib0.Sexp.t -> group
val sexp_of_group : group -> Sexplib0.Sexp.t
val named_group_to_group : Packet.named_group -> [> `FFDHE2048 | `FFDHE3072 | `FFDHE4096 | `FFDHE6144 | `FFDHE8192 | `P256 | `X25519 ] option
val group_to_named_group : [< `FFDHE2048 | `FFDHE3072 | `FFDHE4096 | `FFDHE6144 | `FFDHE8192 | `P256 | `X25519 ] -> Packet.named_group
val group_to_impl : [< `FFDHE2048 | `FFDHE3072 | `FFDHE4096 | `FFDHE6144 | `FFDHE8192 | `P256 | `X25519 ] -> [> `Fiat of [> `P256 ] | `Hacl of [> `X25519 ] | `Mirage_crypto of Mirage_crypto_pk.Dh.group ]
type signature_algorithm = [
  1. | `RSA_PKCS1_MD5
  2. | `RSA_PKCS1_SHA1
  3. | `RSA_PKCS1_SHA224
  4. | `RSA_PKCS1_SHA256
  5. | `RSA_PKCS1_SHA384
  6. | `RSA_PKCS1_SHA512
  7. | `RSA_PSS_RSAENC_SHA256
  8. | `RSA_PSS_RSAENC_SHA384
  9. | `RSA_PSS_RSAENC_SHA512
]
val __signature_algorithm_of_sexp__ : Sexplib0.Sexp.t -> signature_algorithm
val signature_algorithm_of_sexp : Sexplib0.Sexp.t -> signature_algorithm
val sexp_of_signature_algorithm : signature_algorithm -> Sexplib0.Sexp.t
val hash_of_signature_algorithm : [< `RSA_PKCS1_MD5 | `RSA_PKCS1_SHA1 | `RSA_PKCS1_SHA224 | `RSA_PKCS1_SHA256 | `RSA_PKCS1_SHA384 | `RSA_PKCS1_SHA512 | `RSA_PSS_RSAENC_SHA256 | `RSA_PSS_RSAENC_SHA384 | `RSA_PSS_RSAENC_SHA512 ] -> [> `MD5 | `SHA1 | `SHA224 | `SHA256 | `SHA384 | `SHA512 ]
val signature_scheme_of_signature_algorithm : [< `RSA_PKCS1_MD5 | `RSA_PKCS1_SHA1 | `RSA_PKCS1_SHA224 | `RSA_PKCS1_SHA256 | `RSA_PKCS1_SHA384 | `RSA_PKCS1_SHA512 | `RSA_PSS_RSAENC_SHA256 | `RSA_PSS_RSAENC_SHA384 | `RSA_PSS_RSAENC_SHA512 ] -> [> `PKCS1 | `PSS ]
type client_extension = [
  1. | `Hostname of string
  2. | `MaxFragmentLength of Packet.max_fragment_length
  3. | `SupportedGroups of Packet.named_group list
  4. | `SecureRenegotiation of Cstruct_sexp.t
  5. | `Padding of int
  6. | `SignatureAlgorithms of signature_algorithm list
  7. | `ExtendedMasterSecret
  8. | `ALPN of string list
  9. | `KeyShare of (Packet.named_group * Cstruct_sexp.t) list
  10. | `EarlyDataIndication
  11. | `PreSharedKeys of psk_identity list
  12. | `SupportedVersions of tls_any_version list
  13. | `PostHandshakeAuthentication
  14. | `Cookie of Cstruct_sexp.t
  15. | `PskKeyExchangeModes of Packet.psk_key_exchange_mode list
  16. | `ECPointFormats
  17. | `UnknownExtension of int * Cstruct_sexp.t
]
val __client_extension_of_sexp__ : Sexplib0.Sexp.t -> client_extension
val client_extension_of_sexp : Sexplib0.Sexp.t -> client_extension
val sexp_of_client_extension : client_extension -> Sexplib0.Sexp.t
type server13_extension = [
  1. | `KeyShare of group * Cstruct_sexp.t
  2. | `PreSharedKey of int
  3. | `SelectedVersion of tls_version
]
val __server13_extension_of_sexp__ : Sexplib0.Sexp.t -> server13_extension
val server13_extension_of_sexp : Sexplib0.Sexp.t -> server13_extension
val sexp_of_server13_extension : server13_extension -> Sexplib0.Sexp.t
type server_extension = [
  1. | server13_extension
  2. | `Hostname
  3. | `MaxFragmentLength of Packet.max_fragment_length
  4. | `SecureRenegotiation of Cstruct_sexp.t
  5. | `ExtendedMasterSecret
  6. | `ALPN of string
  7. | `ECPointFormats
  8. | `UnknownExtension of int * Cstruct_sexp.t
]
val __server_extension_of_sexp__ : Sexplib0.Sexp.t -> server_extension
val server_extension_of_sexp : Sexplib0.Sexp.t -> server_extension
val sexp_of_server_extension : server_extension -> Sexplib0.Sexp.t
type encrypted_extension = [
  1. | `Hostname
  2. | `MaxFragmentLength of Packet.max_fragment_length
  3. | `SupportedGroups of group list
  4. | `ALPN of string
  5. | `EarlyDataIndication
  6. | `UnknownExtension of int * Cstruct_sexp.t
]
val __encrypted_extension_of_sexp__ : Sexplib0.Sexp.t -> encrypted_extension
val encrypted_extension_of_sexp : Sexplib0.Sexp.t -> encrypted_extension
val sexp_of_encrypted_extension : encrypted_extension -> Sexplib0.Sexp.t
type hello_retry_extension = [
  1. | `SelectedGroup of group
  2. | `Cookie of Cstruct_sexp.t
  3. | `SelectedVersion of tls_version
  4. | `UnknownExtension of int * Cstruct_sexp.t
]
val __hello_retry_extension_of_sexp__ : Sexplib0.Sexp.t -> hello_retry_extension
val hello_retry_extension_of_sexp : Sexplib0.Sexp.t -> hello_retry_extension
val sexp_of_hello_retry_extension : hello_retry_extension -> Sexplib0.Sexp.t
type client_hello = {
  1. client_version : tls_any_version;
  2. client_random : Cstruct_sexp.t;
  3. sessionid : SessionID.t option;
  4. ciphersuites : Packet.any_ciphersuite list;
  5. extensions : client_extension list;
}
val client_hello_of_sexp : Sexplib0.Sexp.t -> client_hello
val sexp_of_client_hello : client_hello -> Sexplib0.Sexp.t
type server_hello = {
  1. server_version : tls_version;
  2. server_random : Cstruct_sexp.t;
  3. sessionid : SessionID.t option;
  4. ciphersuite : Ciphersuite.ciphersuite;
  5. extensions : server_extension list;
}
val server_hello_of_sexp : Sexplib0.Sexp.t -> server_hello
val sexp_of_server_hello : server_hello -> Sexplib0.Sexp.t
type dh_parameters = {
  1. dh_p : Cstruct_sexp.t;
  2. dh_g : Cstruct_sexp.t;
  3. dh_Ys : Cstruct_sexp.t;
}
val dh_parameters_of_sexp : Sexplib0.Sexp.t -> dh_parameters
val sexp_of_dh_parameters : dh_parameters -> Sexplib0.Sexp.t
type hello_retry = {
  1. retry_version : tls_version;
  2. ciphersuite : Ciphersuite.ciphersuite13;
  3. sessionid : SessionID.t option;
  4. selected_group : group;
  5. extensions : hello_retry_extension list;
}
val hello_retry_of_sexp : Sexplib0.Sexp.t -> hello_retry
val sexp_of_hello_retry : hello_retry -> Sexplib0.Sexp.t
type session_ticket_extension = [
  1. | `EarlyDataIndication of int32
  2. | `UnknownExtension of int * Cstruct_sexp.t
]
val __session_ticket_extension_of_sexp__ : Sexplib0.Sexp.t -> session_ticket_extension
val session_ticket_extension_of_sexp : Sexplib0.Sexp.t -> session_ticket_extension
val sexp_of_session_ticket_extension : session_ticket_extension -> Sexplib0.Sexp.t
type session_ticket = {
  1. lifetime : int32;
  2. age_add : int32;
  3. nonce : Cstruct_sexp.t;
  4. ticket : Cstruct_sexp.t;
  5. extensions : session_ticket_extension list;
}
val session_ticket_of_sexp : Sexplib0.Sexp.t -> session_ticket
val sexp_of_session_ticket : session_ticket -> Sexplib0.Sexp.t
type certificate_request_extension = [
  1. | `SignatureAlgorithms of signature_algorithm list
  2. | `CertificateAuthorities of X509.Distinguished_name.t list
  3. | `UnknownExtension of int * Cstruct_sexp.t
]
type tls_handshake =
  1. | HelloRequest
  2. | HelloRetryRequest of hello_retry
  3. | EncryptedExtensions of encrypted_extension list
  4. | ServerHelloDone
  5. | ClientHello of client_hello
  6. | ServerHello of server_hello
  7. | Certificate of Cstruct_sexp.t
  8. | ServerKeyExchange of Cstruct_sexp.t
  9. | CertificateRequest of Cstruct_sexp.t
  10. | ClientKeyExchange of Cstruct_sexp.t
  11. | CertificateVerify of Cstruct_sexp.t
  12. | Finished of Cstruct_sexp.t
  13. | SessionTicket of session_ticket
  14. | KeyUpdate of Packet.key_update_request_type
  15. | EndOfEarlyData
val tls_handshake_of_sexp : Sexplib0.Sexp.t -> tls_handshake
val sexp_of_tls_handshake : tls_handshake -> Sexplib0.Sexp.t
val tls_alert_of_sexp : Sexplib0.Sexp.t -> tls_alert
val sexp_of_tls_alert : tls_alert -> Sexplib0.Sexp.t
type master_secret = Cstruct_sexp.t

the master secret of a TLS connection

val master_secret_of_sexp : Sexplib0.Sexp.t -> master_secret
val sexp_of_master_secret : master_secret -> Sexplib0.Sexp.t
module Cert : sig ... end
module Ptime : sig ... end
type psk13 = {
  1. identifier : Cstruct_sexp.t;
  2. obfuscation : int32;
  3. secret : Cstruct_sexp.t;
  4. lifetime : int32;
  5. early_data : int32;
  6. issued_at : Ptime.t;
}
val psk13_of_sexp : Sexplib0.Sexp.t -> psk13
val sexp_of_psk13 : psk13 -> Sexplib0.Sexp.t
type epoch_state = [
  1. | `ZeroRTT
  2. | `Established
]
val __epoch_state_of_sexp__ : Sexplib0.Sexp.t -> epoch_state
val epoch_state_of_sexp : Sexplib0.Sexp.t -> epoch_state
val sexp_of_epoch_state : epoch_state -> Sexplib0.Sexp.t
type epoch_data = {
  1. state : epoch_state;
  2. protocol_version : tls_version;
  3. ciphersuite : Ciphersuite.ciphersuite;
  4. peer_random : Cstruct_sexp.t;
  5. peer_certificate_chain : Cert.t list;
  6. peer_certificate : Cert.t option;
  7. peer_name : string option;
  8. trust_anchor : Cert.t option;
  9. received_certificates : Cert.t list;
  10. own_random : Cstruct_sexp.t;
  11. own_certificate : Cert.t list;
  12. own_private_key : Mirage_crypto_pk.Rsa.priv option;
  13. own_name : string option;
  14. master_secret : master_secret;
  15. session_id : SessionID.t;
  16. extended_ms : bool;
  17. alpn_protocol : string option;
}

information about an open session

val epoch_data_of_sexp : Sexplib0.Sexp.t -> epoch_data
val sexp_of_epoch_data : epoch_data -> Sexplib0.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
OCaml

Innovation. Community. Security.