+ Future_sign_key
This commit is contained in:
parent
c991f29b28
commit
46caf0b578
2 changed files with 28 additions and 1 deletions
25
src/json.ml
25
src/json.ml
|
|
@ -83,6 +83,8 @@ module Eddsa = struct
|
|||
let dec = Jsont.Base.dec_result pub_of_string in
|
||||
let enc = Jsont.Base.enc pub_to_string in
|
||||
Jsont.Base.string (Jsont.Base.map ~kind:"EddsaPublicKey" ~dec ~enc ())
|
||||
|
||||
let signature_jsont = Jsont.string
|
||||
end
|
||||
|
||||
module Rsa_denomination_key = struct
|
||||
|
|
@ -130,3 +132,26 @@ module Denomination_key = struct
|
|||
|> case_mem "cipher" Jsont.string ~enc:Fun.id ~enc_case cases
|
||||
|> finish
|
||||
end
|
||||
|
||||
module Future_sign_key = struct
|
||||
open Future_sign_key
|
||||
|
||||
let jsont =
|
||||
(* TODO ppx? *)
|
||||
let make key stamp_start stamp_expire stamp_end signkey_secmod_sig =
|
||||
{ key; stamp_start; stamp_expire; stamp_end; signkey_secmod_sig }
|
||||
in
|
||||
let key v = v.key in
|
||||
let stamp_start v = v.stamp_start in
|
||||
let stamp_expire v = v.stamp_expire in
|
||||
let stamp_end v = v.stamp_end in
|
||||
let signkey_secmod_sig v = v.signkey_secmod_sig in
|
||||
let open Jsont.Object in
|
||||
map ~kind:"FutureSignKey" make
|
||||
|> mem "key" Eddsa.pub_jsont ~enc:key
|
||||
|> mem "stamp_start" Timestamp.jsont ~enc:stamp_start
|
||||
|> mem "stamp_expire" Timestamp.jsont ~enc:stamp_expire
|
||||
|> mem "stamp_end" Timestamp.jsont ~enc:stamp_end
|
||||
|> mem "signkey_secmod_sig" Eddsa.signature_jsont ~enc:signkey_secmod_sig
|
||||
|> finish
|
||||
end
|
||||
|
|
|
|||
|
|
@ -131,7 +131,9 @@ module Eddsa = struct
|
|||
pub |> Mirage_crypto_ec.Ed25519.pub_to_octets |> Base_32.encode
|
||||
|
||||
(* EdDSA signatures are transmitted as 64-bytes base32
|
||||
binary-encoded objects with just the R and S values (base32_ binary-only). *)
|
||||
binary-encoded objects with just the R and S values (base32_ binary-only).
|
||||
|
||||
They are signature over a c-struct like `TALER_xxxPS` + with a purpose *)
|
||||
type signature = string
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue