This commit is contained in:
parent
c570d69338
commit
41a52fadae
5 changed files with 5 additions and 53 deletions
12
src/keys.ml
12
src/keys.ml
|
|
@ -6,22 +6,16 @@ type 'a result = ('a, string) Result.t
|
||||||
|
|
||||||
module type S = Mod_intf.KEYS
|
module type S = Mod_intf.KEYS
|
||||||
|
|
||||||
(*
|
|
||||||
(Sm_eddsa : Mod_intf.SECMOD_EDDSA)
|
|
||||||
(Sm_rsa : Mod_intf.SECMOD_RSA)
|
|
||||||
*)
|
|
||||||
|
|
||||||
module Make (Conn : Pg.CONN) = struct
|
module Make (Conn : Pg.CONN) = struct
|
||||||
let conn = (module Conn : Pg.CONN)
|
|
||||||
|
|
||||||
module Sm_eddsa = Secmod_eddsa.Make ()
|
module Sm_eddsa = Secmod_eddsa.Make ()
|
||||||
module Sm_rsa = Secmod_rsa.Make ()
|
module Sm_rsa = Secmod_rsa.Make ()
|
||||||
|
|
||||||
let secmod_eddsa_pub = Sm_eddsa.sm_pub
|
let conn = (module Conn : Pg.CONN)
|
||||||
let secmod_rsa_pub = Sm_rsa.sm_pub
|
|
||||||
|
|
||||||
(* - *)
|
(* - *)
|
||||||
let master_pub = Config.Exchange.master_public_key
|
let master_pub = Config.Exchange.master_public_key
|
||||||
|
let secmod_eddsa_pub = Sm_eddsa.sm_pub
|
||||||
|
let secmod_rsa_pub = Sm_rsa.sm_pub
|
||||||
|
|
||||||
(* TODO error
|
(* TODO error
|
||||||
should be a "key not found", either:
|
should be a "key not found", either:
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,3 @@
|
||||||
module type S = Mod_intf.KEYS
|
module type S = Mod_intf.KEYS
|
||||||
|
|
||||||
module Make (_ : Pg.CONN) : S
|
module Make (_ : Pg.CONN) : S
|
||||||
|
|
||||||
(*
|
|
||||||
(_ : Mod_intf.SECMOD_EDDSA)
|
|
||||||
(_ : Mod_intf.SECMOD_RSA)
|
|
||||||
*)
|
|
||||||
|
|
|
||||||
|
|
@ -27,30 +27,3 @@ module type KEYS = sig
|
||||||
val revoke_denomination :
|
val revoke_denomination :
|
||||||
denom_hash -> Signatures.MasterDenominationKeyRevocation.t -> unit result
|
denom_hash -> Signatures.MasterDenominationKeyRevocation.t -> unit result
|
||||||
end
|
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
|
|
||||||
|
|
|
||||||
|
|
@ -162,13 +162,8 @@ let init () =
|
||||||
|
|
||||||
type info = eddsa_pub * Time.Absolute.t * Time.Absolute.t
|
type info = eddsa_pub * Time.Absolute.t * Time.Absolute.t
|
||||||
|
|
||||||
module Make () :
|
module Make () = struct
|
||||||
Mod_intf.SECMOD
|
|
||||||
with type pub = eddsa_pub
|
|
||||||
and type sig_typ = eddsa_sig
|
|
||||||
and type info = info = struct
|
|
||||||
type pub = EddsaPublicKey.t
|
type pub = EddsaPublicKey.t
|
||||||
type sig_typ = EddsaSignature.t
|
|
||||||
type info = EddsaPublicKey.t * Time.Absolute.t * Time.Absolute.t
|
type info = EddsaPublicKey.t * Time.Absolute.t * Time.Absolute.t
|
||||||
|
|
||||||
let t =
|
let t =
|
||||||
|
|
|
||||||
|
|
@ -187,13 +187,8 @@ let init () =
|
||||||
|
|
||||||
type info = string * rsa_pub * Time.Absolute.t * Time.Absolute.t
|
type info = string * rsa_pub * Time.Absolute.t * Time.Absolute.t
|
||||||
|
|
||||||
module Make () :
|
module Make () = struct
|
||||||
Mod_intf.SECMOD
|
|
||||||
with type pub = rsa_pub
|
|
||||||
and type sig_typ = rsa_sig
|
|
||||||
and type info = info = struct
|
|
||||||
type pub = RsaPublicKey.t
|
type pub = RsaPublicKey.t
|
||||||
type sig_typ = RsaSignature.t
|
|
||||||
type info = string * RsaPublicKey.t * Time.Absolute.t * Time.Absolute.t
|
type info = string * RsaPublicKey.t * Time.Absolute.t * Time.Absolute.t
|
||||||
|
|
||||||
(* --- *)
|
(* --- *)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue