diff options
Diffstat (limited to 'Types.hs')
-rw-r--r-- | Types.hs | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -9,9 +9,11 @@ module Types where import Types.Cost import qualified Data.ByteString as B +import qualified Data.Text as T import Data.String import Control.DeepSeq import GHC.Generics (Generic) +import Data.Aeson -- | keysafe stores secret keys. newtype SecretKey = SecretKey B.ByteString @@ -53,11 +55,17 @@ newtype Name = Name B.ByteString -- | Source of the secret key stored in keysafe. data SecretKeySource = GpgKey KeyId | KeyFile FilePath - deriving (Show) + deriving (Show, Generic) + +instance ToJSON SecretKeySource +instance FromJSON SecretKeySource -- | The keyid is any value that is unique to a private key, and can be -- looked up somehow without knowing the private key. -- -- A gpg keyid is the obvious example. -data KeyId = KeyId B.ByteString - deriving (Show) +data KeyId = KeyId T.Text + deriving (Show, Generic) + +instance ToJSON KeyId +instance FromJSON KeyId |