functorize secmod
This commit is contained in:
parent
7f440077ed
commit
c570d69338
7 changed files with 157 additions and 96 deletions
|
|
@ -1,13 +1,13 @@
|
|||
open Crypto
|
||||
|
||||
type 'a result = ('a, string) Result.t
|
||||
|
||||
module type KEYS = sig
|
||||
open Crypto
|
||||
|
||||
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 -> string
|
||||
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
|
||||
|
|
@ -27,3 +27,30 @@ module type KEYS = sig
|
|||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue