fix secmod + FAT
This commit is contained in:
parent
67e09d38b6
commit
4e40ceb08d
10 changed files with 170 additions and 206 deletions
|
|
@ -238,6 +238,23 @@ module RsaPrivateKey = struct
|
|||
let of_octets = Binary_format_rsa.priv_of_octets
|
||||
let to_octets = Binary_format_rsa.priv_to_octets
|
||||
|
||||
(* we use Bin.cstring because size of key (~bits) can change depending on section_name
|
||||
we also have to b32 encode/decode our octets because of null-char
|
||||
|
||||
enforce all to be of the same size instead? *)
|
||||
let bin =
|
||||
let of_octets_exn s =
|
||||
let res =
|
||||
let* s = B32.decode s in
|
||||
of_octets s
|
||||
in
|
||||
match res with
|
||||
| Error e -> Fmt.failwith "RsaPrivateKey.bin decoding failure: %s." e
|
||||
| Ok t -> t
|
||||
in
|
||||
let to_octets t = to_octets t |> B32.encode in
|
||||
Bin.map Bin.cstring of_octets_exn to_octets
|
||||
|
||||
let jsont =
|
||||
let of_b32 s =
|
||||
let* s = B32.decode s in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue