sig
type ptype = [ `GSSAPI | `SASL ]
type profile = {
ptype : Netmech_scram.ptype;
hash_function : Netsys_digests.iana_hash_fn;
return_unknown_user : bool;
iteration_count_limit : int;
}
type cb = Netsys_sasl_types.cb
type server_error =
[ `Channel_binding_not_supported
| `Channel_bindings_dont_match
| `Extension of string
| `Extensions_not_supported
| `Invalid_encoding
| `Invalid_proof
| `Invalid_username_encoding
| `No_resources
| `Other_error
| `Server_does_support_channel_binding
| `Unknown_user
| `Unsupported_channel_binding_type ]
type client_session
type server_session
exception Invalid_encoding of string * string
exception Invalid_username_encoding of string * string
exception Extensions_not_supported of string * string
exception Protocol_error of string
exception Invalid_server_signature
exception Server_error of Netmech_scram.server_error
val error_of_exn : exn -> string
val profile :
?return_unknown_user:bool ->
?iteration_count_limit:int ->
Netmech_scram.ptype ->
Netsys_digests.iana_hash_fn -> Netmech_scram.profile
val string_of_server_error : Netmech_scram.server_error -> string
val server_error_of_string : string -> Netmech_scram.server_error
val mechanism_name : Netmech_scram.profile -> string
val create_client_session :
?nonce:string ->
Netmech_scram.profile -> string -> string -> Netmech_scram.client_session
val create_client_session2 :
?nonce:string ->
Netmech_scram.profile ->
string -> string -> string -> Netmech_scram.client_session
val client_configure_channel_binding :
Netmech_scram.client_session ->
Netmech_scram.cb -> Netmech_scram.client_session
val client_restart :
Netmech_scram.client_session -> string -> Netmech_scram.client_session
val client_restart_stale :
Netmech_scram.client_session -> string -> Netmech_scram.client_session
val client_emit_flag : Netmech_scram.client_session -> bool
val client_recv_flag : Netmech_scram.client_session -> bool
val client_finish_flag : Netmech_scram.client_session -> bool
val client_semifinish_flag : Netmech_scram.client_session -> bool
val client_error_flag : Netmech_scram.client_session -> exn option
val client_channel_binding :
Netmech_scram.client_session -> Netmech_scram.cb
val client_emit_message :
Netmech_scram.client_session -> Netmech_scram.client_session * string
val client_emit_message_kv :
Netmech_scram.client_session ->
Netmech_scram.client_session * string option * (string * string) list
val client_recv_message :
Netmech_scram.client_session -> string -> Netmech_scram.client_session
val client_protocol_key : Netmech_scram.client_session -> string option
val client_user_name : Netmech_scram.client_session -> string
val client_authz_name : Netmech_scram.client_session -> string
val client_password : Netmech_scram.client_session -> string
val client_export : Netmech_scram.client_session -> string
val client_import : string -> Netmech_scram.client_session
val client_prop : Netmech_scram.client_session -> string -> string
type credentials =
[ `Salted_password of string * string * int
| `Stored_creds of string * string * string * int ]
val create_server_session :
?nonce:string ->
Netmech_scram.profile ->
(string -> Netmech_scram.credentials) -> Netmech_scram.server_session
val create_server_session2 :
?nonce:string ->
Netmech_scram.profile ->
(string -> string -> Netmech_scram.credentials) ->
Netmech_scram.server_session
val create_salt : unit -> string
val salt_password :
Netsys_digests.iana_hash_fn -> string -> string -> int -> string
val stored_key :
Netsys_digests.iana_hash_fn -> string -> string -> int -> string * string
val server_emit_flag : Netmech_scram.server_session -> bool
val server_recv_flag : Netmech_scram.server_session -> bool
val server_finish_flag : Netmech_scram.server_session -> bool
val server_error_flag : Netmech_scram.server_session -> bool
val server_emit_message :
Netmech_scram.server_session -> Netmech_scram.server_session * string
val server_emit_message_kv :
Netmech_scram.server_session ->
Netmech_scram.server_session * (string * string) list
val server_recv_message :
Netmech_scram.server_session -> string -> Netmech_scram.server_session
val server_protocol_key : Netmech_scram.server_session -> string option
val server_channel_binding :
Netmech_scram.server_session -> Netmech_scram.cb
val server_user_name : Netmech_scram.server_session -> string option
val server_authz_name : Netmech_scram.server_session -> string option
val server_export : Netmech_scram.server_session -> string
val server_import : string -> Netmech_scram.server_session
val server_import_any :
string ->
(string -> Netmech_scram.credentials) -> Netmech_scram.server_session
val server_import_any2 :
string ->
(string -> string -> Netmech_scram.credentials) ->
Netmech_scram.server_session
val server_prop : Netmech_scram.server_session -> string -> string
type specific_keys = { kc : string; ke : string; ki : string; }
module AES_CTS :
sig
val c : int
val m : int
val encrypt : string -> string -> string
val encrypt_mstrings :
string -> Netxdr_mstring.mstring list -> Netxdr_mstring.mstring list
val decrypt : string -> string -> string
val decrypt_mstrings :
string -> Netxdr_mstring.mstring list -> Netxdr_mstring.mstring list
val tests : (string * string * string) list
val run_tests : unit -> bool
val run_mtests : unit -> bool
end
module Cryptosystem :
sig
exception Integrity_error
val derive_keys : string -> int -> Netmech_scram.specific_keys
val encrypt_and_sign : Netmech_scram.specific_keys -> string -> string
val encrypt_and_sign_mstrings :
Netmech_scram.specific_keys ->
Netxdr_mstring.mstring list -> Netxdr_mstring.mstring list
val decrypt_and_verify :
Netmech_scram.specific_keys -> string -> string
val decrypt_and_verify_mstrings :
Netmech_scram.specific_keys ->
Netxdr_mstring.mstring list -> Netxdr_mstring.mstring list
val get_ec : Netmech_scram.specific_keys -> int -> int
val get_mic : Netmech_scram.specific_keys -> string -> string
val get_mic_mstrings :
Netmech_scram.specific_keys -> Netxdr_mstring.mstring list -> string
end
module Debug : sig val enable : bool Stdlib.ref end
end