mte/src/signkey.ml

24 lines
573 B
OCaml
Raw Normal View History

2025-12-03 16:19:11 +01:00
open Crypto
type t = {
pub: eddsa_pub;
stamp_start: Timestamp.t;
stamp_expire: Timestamp.t;
stamp_end: Timestamp.t;
2026-02-17 09:30:20 +01:00
master_sig: Signatures.ExchangeSigningKeyValidity.t;
2025-12-03 16:19:11 +01:00
}
2026-02-26 17:04:48 +01:00
2026-02-27 20:28:56 +01:00
let verify_exchange_signing_key_validity ~key sk =
let open Signatures.ExchangeSigningKeyValidity in
verify key sk.master_sig
{
R.start= sk.stamp_start;
expire= sk.stamp_expire;
end_= sk.stamp_end;
signkey_pub= sk.pub;
}
2026-02-26 17:04:48 +01:00
let is_valid_at ~timestamp sk =
2026-02-27 22:44:49 +01:00
Timestamp.compare sk.stamp_start timestamp <= 0
&& Timestamp.compare timestamp sk.stamp_end < 0