rename
This commit is contained in:
parent
15c132829e
commit
f0254c6f5d
9 changed files with 140 additions and 137 deletions
|
|
@ -1,71 +0,0 @@
|
|||
open Crypto
|
||||
|
||||
type t = {
|
||||
pub: RsaPublicKey.t;
|
||||
priv: RsaPrivateKey.t;
|
||||
section_name: string;
|
||||
value: Amount.t;
|
||||
stamp_start: Timestamp.t;
|
||||
stamp_expire_withdraw: Timestamp.t;
|
||||
stamp_expire_deposit: Timestamp.t;
|
||||
stamp_expire_legal: Timestamp.t;
|
||||
fee_withdraw: Amount.t;
|
||||
fee_deposit: Amount.t;
|
||||
fee_refresh: Amount.t;
|
||||
fee_refund: Amount.t;
|
||||
age_mask: int;
|
||||
h_pub: Bin_type.DenominationHash.t;
|
||||
master_sig: Bin_sig.DenominationKeyValidity.t option;
|
||||
}
|
||||
|
||||
let make
|
||||
({
|
||||
section_name;
|
||||
value;
|
||||
duration_withdraw;
|
||||
duration_spend;
|
||||
duration_legal;
|
||||
fee_withdraw;
|
||||
fee_deposit;
|
||||
fee_refresh;
|
||||
fee_refund;
|
||||
cipher;
|
||||
rsa_keysize;
|
||||
age_restricted= _;
|
||||
} :
|
||||
Config.Coin.t) =
|
||||
assert (cipher = `RSA);
|
||||
|
||||
let stamp_start = Ptime_clock.now () |> Option.some in
|
||||
let stamp_expire_withdraw =
|
||||
Timestamp.add_span_exn stamp_start (Some duration_withdraw)
|
||||
in
|
||||
let stamp_expire_deposit =
|
||||
Timestamp.add_span_exn stamp_start (Some duration_spend)
|
||||
in
|
||||
let stamp_expire_legal =
|
||||
Timestamp.add_span_exn stamp_start (Some duration_legal)
|
||||
in
|
||||
|
||||
let open Mirage_crypto_pk.Rsa in
|
||||
let priv = generate ~bits:rsa_keysize () in
|
||||
let pub = pub_of_priv priv in
|
||||
let h_pub = Bin_type.DenominationHash.hash (RsaPublicKey.to_octets pub) in
|
||||
let master_sig = None in
|
||||
{
|
||||
pub;
|
||||
priv;
|
||||
section_name;
|
||||
value;
|
||||
stamp_start;
|
||||
stamp_expire_withdraw;
|
||||
stamp_expire_deposit;
|
||||
stamp_expire_legal;
|
||||
fee_withdraw;
|
||||
fee_deposit;
|
||||
fee_refresh;
|
||||
fee_refund;
|
||||
age_mask= 0;
|
||||
h_pub;
|
||||
master_sig;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue