package ezjs_crypto
Module Ezjs_cryptoSource
Source
type crypt_params = | RSA_OAEP of Ezjs_min.Typed_array.Bigstring.t option| AES_CTR of Ezjs_min.Typed_array.Bigstring.t * int| AES_CBC of Ezjs_min.Typed_array.Bigstring.t| AES_GCM of Ezjs_min.Typed_array.Bigstring.t * Ezjs_min.Typed_array.Bigstring.t option * int option
Source
type 'usage crypto_key = {kind : string;extractable : bool;algorithm : keygen_params;usages : 'usage list;
}Source
type 'usage crypto_keypair = {public_key : 'usage crypto_key;private_key : 'usage crypto_key;
}Source
type derive_algo = | ECDH of derive_usage crypto_key| HKDF of sha_algo * Ezjs_min.Typed_array.Bigstring.t * Ezjs_min.Typed_array.Bigstring.t| PBKDF2 of sha_algo * Ezjs_min.Typed_array.Bigstring.t * int
Source
val to_keygen_params0 :
?mod_length:int ->
?exponent:int list option ->
?sha:sha_algo ->
?length:int ->
?curve:ec_curve ->
string ->
keygenParams Ezjs_min.tSource
val to_derive_params0 :
?public:cryptoKey Ezjs_min.t ->
?sha:sha_algo ->
?salt:Ezjs_min.Typed_array.Bigstring.t ->
?info:Ezjs_min.Typed_array.Bigstring.t ->
?iterations:int ->
string ->
deriveParams Ezjs_min.tSource
val to_crypt_params0 :
?label:Ezjs_min.Typed_array.Bigstring.t ->
?counter:Ezjs_min.Typed_array.Bigstring.t ->
?length:int ->
?iv:Ezjs_min.Typed_array.Bigstring.t ->
?data:Ezjs_min.Typed_array.Bigstring.t ->
?tag_length:int ->
string ->
cryptParams Ezjs_min.tSource
val to_import_params_base :
?sha:sha_algo ->
?curve:ec_curve ->
string ->
importParams0 Ezjs_min.tSource
val of_crypto_key :
< algorithm : < get : keygenParams Ezjs_min.t.. > Js_of_ocaml.Js.gen_prop
; extractable : < get : bool Ezjs_min.t.. > Js_of_ocaml.Js.gen_prop
; type_ : < get : Ezjs_min.js_string Ezjs_min.t.. > Js_of_ocaml.Js.gen_prop
; usages :
< get : Ezjs_min.js_string Ezjs_min.t Ezjs_min.js_array Ezjs_min.t.. >
Js_of_ocaml.Js.gen_prop.. >
Js_of_ocaml.Js.t ->
usage crypto_keySource
val of_crypto_keypair :
< privateKey :
< get :
< algorithm : < get : keygenParams Ezjs_min.t.. > Js_of_ocaml.Js.gen_prop
; extractable : < get : bool Ezjs_min.t.. > Js_of_ocaml.Js.gen_prop
; type_ :
< get : Ezjs_min.js_string Ezjs_min.t.. > Js_of_ocaml.Js.gen_prop
; usages :
< get : Ezjs_min.js_string Ezjs_min.t Ezjs_min.js_array Ezjs_min.t.. >
Js_of_ocaml.Js.gen_prop.. >
Js_of_ocaml.Js.t.. >
Js_of_ocaml.Js.gen_prop
; publicKey :
< get :
< algorithm :
< get : keygenParams Ezjs_min.t.. > Js_of_ocaml.Js.gen_prop
; extractable : < get : bool Ezjs_min.t.. > Js_of_ocaml.Js.gen_prop
; type_ :
< get : Ezjs_min.js_string Ezjs_min.t.. > Js_of_ocaml.Js.gen_prop
; usages :
< get : Ezjs_min.js_string Ezjs_min.t Ezjs_min.js_array Ezjs_min.t.. >
Js_of_ocaml.Js.gen_prop.. >
Js_of_ocaml.Js.t.. >
Js_of_ocaml.Js.gen_prop.. >
Js_of_ocaml.Js.t ->
usage crypto_keypairSource
val to_bigstring :
((Ezjs_min.Typed_array.Bigstring.t, 'a) Ezjs_min.result -> 'b) ->
(Js_of_ocaml__Typed_array.arrayBuffer Js_of_ocaml.Js.t, 'a) Ezjs_min.result ->
'bSource
val encrypt :
algo:crypt_params ->
key:crypt_usage crypto_key ->
Ezjs_min.Typed_array.Bigstring.t ->
((Ezjs_min.Typed_array.Bigstring.t, Js_of_ocaml.Js.Js_error.error_t)
Ezjs_min.result ->
unit) ->
unitSource
val decrypt :
algo:crypt_params ->
key:crypt_usage crypto_key ->
Ezjs_min.Typed_array.Bigstring.t ->
((Ezjs_min.Typed_array.Bigstring.t, Js_of_ocaml.Js.Js_error.error_t)
Ezjs_min.result ->
unit) ->
unitSource
val sign :
algo:sign_params ->
key:sign_usage crypto_key ->
Ezjs_min.Typed_array.Bigstring.t ->
((Ezjs_min.Typed_array.Bigstring.t, Js_of_ocaml.Js.Js_error.error_t)
Ezjs_min.result ->
unit) ->
unitSource
val verify :
algo:sign_params ->
key:sign_usage crypto_key ->
Ezjs_min.Typed_array.Bigstring.t ->
Ezjs_min.Typed_array.Bigstring.t ->
((bool, Js_of_ocaml.Js.Js_error.error_t) Ezjs_min.result -> unit) ->
unitSource
val digest :
algo:sha_algo ->
Ezjs_min.Typed_array.Bigstring.t ->
((Ezjs_min.Typed_array.Bigstring.t, Js_of_ocaml.Js.Js_error.error_t)
Ezjs_min.result ->
unit) ->
unitSource
val generate_symmetric_key :
?extractable:bool ->
algo:keygen_params ->
usages:[< usage ] list ->
((usage crypto_key, Js_of_ocaml.Js.Js_error.error_t) Ezjs_min.result -> unit) ->
unitSource
val generate_asymmetric_key :
?extractable:bool ->
algo:keygen_params ->
usages:[< usage ] list ->
((usage crypto_keypair, Ezjs_min.error Js_of_ocaml.Js.t) Ezjs_min.result ->
unit) ->
unitSource
val generate_key :
?extractable:bool ->
algo:keygen_params ->
usages:[< usage ] list ->
((usage crypto_key_all, Js_of_ocaml.Js.Js_error.error_t) Ezjs_min.result ->
unit) ->
unitSource
val derive_key :
?extractable:bool ->
algo:derive_algo ->
dalgo:keygen_params ->
key:derive_usage crypto_key ->
usages:[< usage ] list ->
((usage crypto_key, Js_of_ocaml.Js.Js_error.error_t) Ezjs_min.result -> unit) ->
unitSource
val derive_bits :
algo:derive_algo ->
key:derive_usage crypto_key ->
length:int ->
((Ezjs_min.Typed_array.Bigstring.t, Js_of_ocaml.Js.Js_error.error_t)
Ezjs_min.result ->
unit) ->
unitSource
val import_key :
?extractable:bool ->
?format:key_format ->
data:Ezjs_min.Typed_array.Bigstring.t ->
algo:import_params ->
usages:[< usage ] list ->
((usage crypto_key, Js_of_ocaml.Js.Js_error.error_t) Ezjs_min.result -> unit) ->
unitSource
val export_key :
?format:key_format ->
[< usage ] crypto_key ->
((Ezjs_min.Typed_array.Bigstring.t, Js_of_ocaml.Js.Js_error.error_t)
Ezjs_min.result ->
unit) ->
unitSource
val wrap_key :
?format:key_format ->
key:[< usage ] crypto_key ->
wkey:crypt_usage crypto_key ->
algo:crypt_params ->
((Ezjs_min.Typed_array.Bigstring.t, Js_of_ocaml.Js.Js_error.error_t)
Ezjs_min.result ->
unit) ->
unitSource
val unwrap_key :
?extractable:bool ->
?format:key_format ->
wkey:Ezjs_min.Typed_array.Bigstring.t ->
ukey:crypt_usage crypto_key ->
ualgo:crypt_params ->
ukeyalgo:import_params ->
usages:[< usage ] list ->
((usage crypto_key, Js_of_ocaml.Js.Js_error.error_t) Ezjs_min.result -> unit) ->
unit