Eio_brr_webcrypto.Subtle_cryptoSubtleCrypto objects
val encrypt :
Brr_webcrypto.Subtle_crypto.t ->
Brr_webcrypto.Crypto_algo.t ->
Brr_webcrypto.Crypto_algo.t ->
('a, 'b) Brr.Tarray.t ->
Brr.Tarray.Buffer.tencrypt s a k data is data encrypted with key k and algorithm a.
val decrypt :
Brr_webcrypto.Subtle_crypto.t ->
Brr_webcrypto.Crypto_algo.t ->
Brr_webcrypto.Crypto_algo.t ->
('a, 'b) Brr.Tarray.t ->
Brr.Tarray.Buffer.tdecrypt s a k data is data decrypted with key k and algorithm a.
val digest :
Brr_webcrypto.Subtle_crypto.t ->
Brr_webcrypto.Crypto_algo.t ->
('a, 'b) Brr.Tarray.t ->
Brr.Tarray.Buffer.tdigest s a data is the digest of data according to algorithm a.
val sign :
Brr_webcrypto.Subtle_crypto.t ->
Brr_webcrypto.Crypto_algo.t ->
Brr_webcrypto.Crypto_algo.t ->
('a, 'b) Brr.Tarray.t ->
Brr.Tarray.Buffer.tsign s a k data is the signature of data with key k and algorithm a.
val verify :
Brr_webcrypto.Subtle_crypto.t ->
Brr_webcrypto.Crypto_algo.t ->
Brr_webcrypto.Crypto_algo.t ->
sig':('a, 'b) Brr.Tarray.t ->
('c, 'd) Brr.Tarray.t ->
boolverify s a k ~sig' data is true iff the signature of data with key k and algorithm a matches sig'.
val generate_key :
Brr_webcrypto.Subtle_crypto.t ->
Brr_webcrypto.Crypto_algo.t ->
extractable:bool ->
usages:Brr_webcrypto.Crypto_key.Usage.t list ->
Brr_webcrypto.Crypto_algo.tgenerate_key s a ~extractable ~usage is a key generated for algorithm a and usages usages. Warning if the algorithm generates a key pair use generate_key_pair.
val generate_key_pair :
Brr_webcrypto.Subtle_crypto.t ->
Brr_webcrypto.Crypto_algo.t ->
extractable:bool ->
usages:Brr_webcrypto.Crypto_key.Usage.t list ->
Brr_webcrypto.Crypto_key.pairgenerate_key_pair s a ~extractable ~usage is a key generated of type and parameters a and usages usages. Warning if the algorithm generates a single key use generate_key.
val derive_bits :
Brr_webcrypto.Subtle_crypto.t ->
Brr_webcrypto.Crypto_algo.t ->
Brr_webcrypto.Crypto_algo.t ->
int ->
Brr.Tarray.Buffer.tderive_bits s a k l are l bits derived from k with algorithm a.
val derive_key :
Brr_webcrypto.Subtle_crypto.t ->
Brr_webcrypto.Crypto_algo.t ->
Brr_webcrypto.Crypto_algo.t ->
derived:Brr_webcrypto.Crypto_algo.t ->
extractable:bool ->
usages:Brr_webcrypto.Crypto_key.Usage.t list ->
Brr_webcrypto.Crypto_algo.tderive_key s a k ~derived_type ~extractable ~usages is a key of type and parameters ~derived and usages usages derived from key k of type and parameters a.
val export_key :
Brr_webcrypto.Subtle_crypto.t ->
Brr_webcrypto.Crypto_key.Format.t ->
Brr_webcrypto.Crypto_algo.t ->
[ `Buffer of Brr.Tarray.Buffer.t | `Json_web_key of Brr.Json.t ]export_key s f k is the key k exported in format f. `Json_web_key is only returned if Brr_webcrypto.Crypto_key.Format.jwk is specified.
val import_key :
Brr_webcrypto.Subtle_crypto.t ->
Brr_webcrypto.Crypto_key.Format.t ->
[ `Buffer of Brr.Tarray.Buffer.t | `Json_web_key of Brr.Json.t ] ->
Brr_webcrypto.Crypto_algo.t ->
extractable:bool ->
usages:Brr_webcrypto.Crypto_key.Usage.t list ->
Brr_webcrypto.Crypto_algo.timport_key s f k a ~extractable ~usages is the key k imported from format f and type a used for usages.
val wrap_key :
Brr_webcrypto.Subtle_crypto.t ->
Brr_webcrypto.Crypto_key.Format.t ->
Brr_webcrypto.Crypto_algo.t ->
wrap_key:Brr_webcrypto.Crypto_algo.t ->
wrapper:Brr_webcrypto.Crypto_algo.t ->
Brr.Tarray.Buffer.twrap_key s f k ~wrap_key ~wrapper is like export_key but encrypts the result with wrap_key ad algorithm wrapper.
val unwrap_key :
Brr_webcrypto.Subtle_crypto.t ->
Brr_webcrypto.Crypto_key.Format.t ->
('a, 'b) Brr.Tarray.t ->
wrap_key:Brr_webcrypto.Crypto_algo.t ->
wrapper:Brr_webcrypto.Crypto_algo.t ->
unwrapped:Brr_webcrypto.Crypto_algo.t ->
extractable:bool ->
usages:Brr_webcrypto.Crypto_key.Usage.t list ->
Brr_webcrypto.Crypto_algo.tunwrap_key s f b ~wrap_key ~wrapper ~unwrapped ~extractable ~usages is like import_key but unwraps the wrapper of b made wtih wrap_key and algorithm wrapped.