ssl_handshake

DATA TYPES

algo_oid() = {1, 2, 840, 113549, 1, 1, 1} | {1, 2, 840, 10040, 4, 1}
certdb_ref() = reference()
db_handle() = term()
der_cert() = binary()
host() = ip_address() (see module inet) | hostname() (see module inet)
key_algo() = null | rsa | dhe_rsa | dhe_dss | dh_anon
private_key() = #'RSAPrivateKey'{} | #'DSAPrivateKey'{}
public_key_info() = {algo_oid(), #'RSAPublicKey'{} | integer(), public_key_params()}
public_key_params() = #'Dss-Parms'{} | term()
session_id() = 0 | binary()
tls_handshake() = #client_hello{} | #server_hello{} | #server_hello_done{} | #certificate{} | #certificate_request{} | #client_key_exchange{} | #finished{} | #certificate_verify{} | #hello_request{} | #next_protocol{}
tls_handshake_history() = {[binary()], [binary()]}
tls_version() = {integer(), integer()}

Functions


client_hello(Host::host(), Port::port_number() (see module inet), Connection_states::#connection_states{}, Ssl_options::#ssl_options{}, Cache::integer(), CacheCb::atom(), Renegotiation::boolean(), OwnCert::der_cert()) -> #client_hello{}

server_hello(SessionId::session_id(), Version::tls_version(), Connection_states::#connection_states{}, Renegotiation::boolean(), ProtocolsAdvertisedOnServer::[binary()] | undefined) -> #server_hello{}

hello_request() -> #hello_request{}

hello(Server_hello::#server_hello{} | #client_hello{}, Ssl_options::#ssl_options{}, ConnectionStates0::#connection_states{} | {port_number() (see module inet), #session{}, db_handle(), atom(), #connection_states{}, binary()}, Renegotiation::boolean()) -> {tls_version(), session_id(), #connection_states{}, binary() | undefined} | {tls_version(), {resumed | new, #session{}}, #connection_states{}, [binary()] | undefined} | #alert{}

certify(Certificate::#certificate{}, CertDbHandle::db_handle(), CertDbRef::certdb_ref(), MaxPathLen::integer() | nolimit, Verify::verify_peer | verify_none, VerifyFunAndState::{function(), term}, Role::client | server) -> {der_cert(), public_key_info()} | #alert{}

certificate(OwnCert::der_cert(), CertDbHandle::db_handle(), CertDbRef::certdb_ref(), X4::client | server) -> #certificate{} | #alert{}

client_certificate_verify(OwnCert::undefined | der_cert(), MasterSecret::binary(), Version::tls_version(), X4::term(), PrivateKey::private_key(), X6::tls_handshake_history()) -> #certificate_verify{} | ignore | #alert{}

certificate_verify(Signature::binary(), PublicKeyInfo::public_key_info(), Version::tls_version(), HashSign::term(), MasterSecret::binary(), X6::tls_handshake_history()) -> valid | #alert{}

verify_signature(Version::tls_version(), Hash::binary(), HashAlgo::{term(), term()}, Signature::binary(), X5::public_key_info()) -> true | false

certificate_request(Connection_states::#connection_states{}, CertDbHandle::db_handle(), CertDbRef::certdb_ref()) -> #certificate_request{}

key_exchange(X1::client | server, Version::tls_version(), X3::{premaster_secret, binary(), public_key_info()} | {dh, binary()} | {dh, {binary(), binary()}, #'DHParameter'{}, {HashAlgo::atom(), SignAlgo::atom()}, binary(), binary(), private_key()}) -> #client_key_exchange{} | #server_key_exchange{}

master_secret(Version::tls_version(), Session::#session{} | binary(), Connection_states::#connection_states{}, Role::client | server) -> {binary(), #connection_states{}} | #alert{}

next_protocol(SelectedProtocol::binary()) -> #next_protocol{}

finished(Version::tls_version(), Role::client | server, PrfAlgo::integer(), MasterSecret::binary(), X5::tls_handshake_history()) -> #finished{}

verify_connection(Version::tls_version(), Finished::#finished{}, Role::client | server, PrfAlgo::integer(), MasterSecret::binary(), X6::tls_handshake_history()) -> verified | #alert{}

server_hello_done() -> #server_hello_done{}

encode_handshake(Package::tls_handshake(), Version::tls_version()) -> iolist()

get_tls_handshake(Version::tls_version(), Data::binary(), Buffer::binary() | iolist()) -> {[tls_handshake()], binary()}

decode_client_key(ClientKey::binary(), Type::key_algo(), Version::tls_version()) -> #encrypted_premaster_secret{} | #client_diffie_hellman_public{}

decode_server_key(ServerKey::binary(), Type::key_algo(), Version::tls_version()) -> #server_key_params{}

init_handshake_history() -> tls_handshake_history()

update_handshake_history(Handshake::tls_handshake_history(), Data::term()) -> tls_handshake_history()

decrypt_premaster_secret(Secret::binary(), RSAPrivateKey::#'RSAPrivateKey'{}) -> binary()

server_key_exchange_hash(Hash::md5sha | md5 | sha | sha224 | sha256 | sha384 | sha512, Value::binary()) -> binary()

prf(X1::tls_version(), Secret::binary(), Label::binary(), Seed::[binary()], WantedLength::non_neg_integer()) -> {ok, binary()} | {error, undefined}

dec_hello_extensions(X1, Acc) -> term()