move cryptographicallySecure into Backend type
This is groundwork for external backends, but also makes sense to keep this information with the rest of a Backend's implementation. Also, removed isVerifiable. I noticed that the same information is encoded by whether a Backend implements verifyKeyContent or not.
This commit is contained in:
parent
4be5567372
commit
172743728e
10 changed files with 38 additions and 41 deletions
|
@ -2,7 +2,7 @@
|
|||
-
|
||||
- Most things should not need this, using Types instead
|
||||
-
|
||||
- Copyright 2010-2019 Joey Hess <id@joeyh.name>
|
||||
- Copyright 2010-2020 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
@ -18,7 +18,8 @@ import Utility.FileSystemEncoding
|
|||
data BackendA a = Backend
|
||||
{ backendVariety :: KeyVariety
|
||||
, getKey :: Maybe (KeySource -> MeterUpdate -> a Key)
|
||||
-- Verifies the content of a key.
|
||||
-- Verifies the content of a key using a hash. This does not need
|
||||
-- to be cryptographically secure.
|
||||
, verifyKeyContent :: Maybe (Key -> FilePath -> a Bool)
|
||||
-- Checks if a key can be upgraded to a better form.
|
||||
, canUpgradeKey :: Maybe (Key -> Bool)
|
||||
|
@ -28,6 +29,8 @@ data BackendA a = Backend
|
|||
-- Checks if a key is known (or assumed) to always refer to the
|
||||
-- same data.
|
||||
, isStableKey :: Key -> Bool
|
||||
-- Checks if a key is verified using a cryptographically secure hash.
|
||||
, isCryptographicallySecure :: Key -> Bool
|
||||
}
|
||||
|
||||
instance Show (BackendA a) where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue