mte/src/mod_intf.mli
2026-02-21 18:43:59 +01:00

56 lines
1.7 KiB
OCaml

open Crypto
type 'a result = ('a, string) Result.t
module type KEYS = sig
val master_pub : eddsa_pub
val secmod_rsa_pub : eddsa_pub
val secmod_eddsa_pub : eddsa_pub
val sign : eddsa_pub -> string -> eddsa_sig
val sign_denom : rsa_pub -> string -> rsa_sig
val find_signkey : eddsa_pub -> Signkey.t option result
val find_denomination : denom_hash -> Denomination.t option result
val signkeys : unit -> Signkey.t list result
val denominations : unit -> Denomination.t list result
val future_signkeys : unit -> Api.FutureSignKey.t list result
val future_denominations : unit -> Api.FutureDenom.t list result
val certify_future_signkey :
eddsa_pub -> Signatures.ExchangeSigningKeyValidity.t -> unit result
val certify_future_denomination :
denom_hash -> Signatures.DenominationKeyValidity.t -> unit result
val revoke_signkey :
eddsa_pub -> Signatures.MasterSigningKeyRevocation.t -> unit result
val revoke_denomination :
denom_hash -> Signatures.MasterDenominationKeyRevocation.t -> unit result
end
module type SECMOD = sig
type pub
type sig_typ
type info
val sm_pub : eddsa_pub
val keys : unit -> info list
val sign_secmod : string -> eddsa_sig
val sign : pub -> string -> (sig_typ, string) Result.t
val revoke : pub -> (unit, string) Result.t
end
type sm_eddsa_info = eddsa_pub * Time.Absolute.t * Time.Absolute.t
type sm_rsa_info = string * rsa_pub * Time.Absolute.t * Time.Absolute.t
module type SECMOD_EDDSA =
SECMOD
with type pub = eddsa_pub
and type sig_typ = eddsa_sig
and type info = sm_eddsa_info
module type SECMOD_RSA =
SECMOD
with type pub = rsa_pub
and type sig_typ = rsa_sig
and type info = sm_rsa_info