55 lines
1.3 KiB
OCaml
55 lines
1.3 KiB
OCaml
|
|
let _denom_signature ~key ~key_pub
|
||
|
|
Api.FutureDenom.
|
||
|
|
{
|
||
|
|
section_name= _;
|
||
|
|
value;
|
||
|
|
stamp_start;
|
||
|
|
stamp_expire_withdraw;
|
||
|
|
stamp_expire_deposit;
|
||
|
|
stamp_expire_legal;
|
||
|
|
denom_pub;
|
||
|
|
fee_withdraw;
|
||
|
|
fee_deposit;
|
||
|
|
fee_refresh;
|
||
|
|
fee_refund= _;
|
||
|
|
(* TODO check sigs *)
|
||
|
|
denom_secmod_sig= _;
|
||
|
|
} =
|
||
|
|
let pub_octets =
|
||
|
|
let denom_pub =
|
||
|
|
match denom_pub with
|
||
|
|
| Rsa v -> v
|
||
|
|
| CS _ -> Fmt.failwith "CS key types are not supported."
|
||
|
|
in
|
||
|
|
let pub = denom_pub.Api.RsaDenominationKey.rsa_pub in
|
||
|
|
Crypto.RsaPublicKey.to_octets pub
|
||
|
|
in
|
||
|
|
let h_denom_pub = Api.HashCode.hash pub_octets in
|
||
|
|
let master_sig =
|
||
|
|
let open Bin_type in
|
||
|
|
let open Bin_signature.DenominationKeyValidityPS in
|
||
|
|
{
|
||
|
|
master= key_pub;
|
||
|
|
start= stamp_start;
|
||
|
|
expire_withdraw= stamp_expire_withdraw;
|
||
|
|
expire_spend= stamp_expire_deposit;
|
||
|
|
expire_legal= stamp_expire_legal;
|
||
|
|
value;
|
||
|
|
fee_withdraw;
|
||
|
|
fee_deposit;
|
||
|
|
fee_refresh;
|
||
|
|
denom_hash= DenominationHash.hash pub_octets;
|
||
|
|
}
|
||
|
|
|> Bin.to_string bin
|
||
|
|
|> Crypto.EddsaSignature.sign ~key
|
||
|
|
in
|
||
|
|
Api.DenomSignature.{ h_denom_pub; master_sig }
|
||
|
|
|
||
|
|
let sign_future_keys ~master_key:_ _future_key_response =
|
||
|
|
(*
|
||
|
|
let open Syntax in
|
||
|
|
let open Crypto in
|
||
|
|
*)
|
||
|
|
(* TODO sign *)
|
||
|
|
assert false
|