add data_file.ml

This commit is contained in:
swrup 2025-11-29 14:03:37 +01:00
parent 760e6de1fb
commit bc91f7357c
8 changed files with 207 additions and 101 deletions

View file

@ -165,6 +165,27 @@ module RsaPublicKey = struct
let jsont = Jsont.of_of_string ~kind:"RsaPublicKey" of_b32 ~enc:to_b32
end
module RsaPrivateKey = struct
open Mirage_crypto_pk.Rsa
type t = priv
let pub_of_priv = pub_of_priv
(* TODO rsa *)
let to_octets _t : string = assert false
let of_octets _t : t = assert false
(*let bin = Bin.map (Bin.bytes 32) of_octets to_octets*)
let of_b32 s =
let open Syntax in
let* octets = B32.decode s in
Ok (of_octets octets)
let to_b32 t = B32.encode (to_octets t)
let jsont = Jsont.of_of_string ~kind:"EddsaPrivateKey" of_b32 ~enc:to_b32
end
module RsaSignature : sig
type t