This commit is contained in:
parent
d2e546571c
commit
e94950df5b
4 changed files with 64 additions and 76 deletions
48
src/keys.ml
48
src/keys.ml
|
|
@ -11,15 +11,11 @@ module type S = sig
|
|||
val find_denomination : denom_hash -> Denomination.t option result
|
||||
val signkeys : unit -> Signkey.t list result
|
||||
val denominations : unit -> Denomination.t list result
|
||||
val find_future_signkey : eddsa_pub -> Api.FutureSignKey.t result
|
||||
val find_future_denomination : denom_hash -> Api.FutureDenom.t result
|
||||
val make_future_keys_response : unit -> Api.FutureKeysResponse.t result
|
||||
|
||||
val certify_future_signkey :
|
||||
eddsa_pub -> Signatures.ExchangeSigningKeyValidity.t -> unit result
|
||||
|
||||
val certify_future_denomination :
|
||||
denom_hash -> Signatures.DenominationKeyValidity.t -> unit result
|
||||
val verify_future_signkey : Api.SignKeySignature.t -> unit result
|
||||
val verify_future_denomination : Api.DenomSignature.t -> unit result
|
||||
val certify_future_signkey : Api.SignKeySignature.t -> unit result
|
||||
val certify_future_denomination : Api.DenomSignature.t -> unit result
|
||||
|
||||
val revoke_signkey :
|
||||
eddsa_pub -> Signatures.MasterSigningKeyRevocation.t -> unit result
|
||||
|
|
@ -277,7 +273,38 @@ module Make (Conn : Pg.CONN) : S = struct
|
|||
master_sig;
|
||||
}
|
||||
|
||||
let certify_future_signkey pub master_sig =
|
||||
let verify_future_signkey Api.SignKeySignature.{ key; master_sig } =
|
||||
let open Signatures.ExchangeSigningKeyValidity in
|
||||
let* fsk = find_future_signkey key in
|
||||
verify Config.master_public_key master_sig
|
||||
{
|
||||
R.start= fsk.stamp_start;
|
||||
expire= fsk.stamp_expire;
|
||||
end_= fsk.stamp_end;
|
||||
signkey_pub= key;
|
||||
}
|
||||
|
||||
let verify_future_denomination Api.DenomSignature.{ h_denom_pub; master_sig }
|
||||
=
|
||||
let open Api.FutureDenom in
|
||||
let open Signatures.DenominationKeyValidity in
|
||||
let* fdn = find_future_denomination h_denom_pub in
|
||||
verify Config.master_public_key master_sig
|
||||
{
|
||||
R.master= Config.master_public_key;
|
||||
start= fdn.stamp_start;
|
||||
expire_withdraw= fdn.stamp_expire_withdraw;
|
||||
expire_spend= fdn.stamp_expire_deposit;
|
||||
expire_legal= fdn.stamp_expire_legal;
|
||||
value= fdn.value;
|
||||
fee_withdraw= fdn.fee_withdraw;
|
||||
fee_deposit= fdn.fee_deposit;
|
||||
fee_refresh= fdn.fee_refresh;
|
||||
fee_refund= fdn.fee_refund;
|
||||
denom_hash= h_denom_pub;
|
||||
}
|
||||
|
||||
let certify_future_signkey Api.SignKeySignature.{ key= pub; master_sig } =
|
||||
match Sm_eddsa.find_key pub with
|
||||
| None -> Error "future signkey not found"
|
||||
| Some (pub, (t1, t2)) -> (
|
||||
|
|
@ -295,7 +322,8 @@ module Make (Conn : Pg.CONN) : S = struct
|
|||
m "certified signkey `%s`" (EddsaPublicKey.to_b32 sk.pub));
|
||||
())
|
||||
|
||||
let certify_future_denomination h_pub master_sig =
|
||||
let certify_future_denomination
|
||||
Api.DenomSignature.{ h_denom_pub= h_pub; master_sig } =
|
||||
match Sm_rsa.find_key h_pub with
|
||||
| None -> Error "future denomination not found"
|
||||
| Some (h_pub, (section_name, pub, t1)) -> (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue