    module Propellor.Types.PrivData where

    import Propellor.Types.OS
    import Utility.PartialPrelude
    import Utility.FileSystemEncoding

    import Data.Maybe
    import qualified Data.ByteString.Lazy as L

    -- | Note that removing or changing constructors or changing types will
    -- break the serialized privdata files, so don't do that!
    -- It's fine to add new constructors.
    data PrivDataField
    	= DockerAuthentication
    	| SshPubKey SshKeyType UserName -- ^ Not used anymore, but retained to avoid breaking serialization of old files
    	| SshPrivKey SshKeyType UserName -- ^ For host key, use empty UserName
    	| SshAuthorizedKeys UserName
    	| Password UserName
    	| CryptPassword UserName
    	| PrivFile FilePath
    	| GpgKey
    	| DnsSec DnsSecKey
    	deriving (ReadPrec [PrivDataField]
    ReadPrec PrivDataField
    Int -> ReadS PrivDataField
    ReadS [PrivDataField]
    (Int -> ReadS PrivDataField)
    -> ReadS [PrivDataField]
    -> ReadPrec PrivDataField
    -> ReadPrec [PrivDataField]
    -> Read PrivDataField
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS PrivDataField
    readsPrec :: Int -> ReadS PrivDataField
    $creadList :: ReadS [PrivDataField]
    readList :: ReadS [PrivDataField]
    $creadPrec :: ReadPrec PrivDataField
    readPrec :: ReadPrec PrivDataField
    $creadListPrec :: ReadPrec [PrivDataField]
    readListPrec :: ReadPrec [PrivDataField]
    Read, Int -> PrivDataField -> ShowS
    [PrivDataField] -> ShowS
    PrivDataField -> UserName
    (Int -> PrivDataField -> ShowS)
    -> (PrivDataField -> UserName)
    -> ([PrivDataField] -> ShowS)
    -> Show PrivDataField
    forall a.
    (Int -> a -> ShowS) -> (a -> UserName) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> PrivDataField -> ShowS
    showsPrec :: Int -> PrivDataField -> ShowS
    $cshow :: PrivDataField -> UserName
    show :: PrivDataField -> UserName
    $cshowList :: [PrivDataField] -> ShowS
    showList :: [PrivDataField] -> ShowS
    Show, Eq PrivDataField
    Eq PrivDataField
    -> (PrivDataField -> PrivDataField -> Ordering)
    -> (PrivDataField -> PrivDataField -> Bool)
    -> (PrivDataField -> PrivDataField -> Bool)
    -> (PrivDataField -> PrivDataField -> Bool)
    -> (PrivDataField -> PrivDataField -> Bool)
    -> (PrivDataField -> PrivDataField -> PrivDataField)
    -> (PrivDataField -> PrivDataField -> PrivDataField)
    -> Ord PrivDataField
    PrivDataField -> PrivDataField -> Bool
    PrivDataField -> PrivDataField -> Ordering
    PrivDataField -> PrivDataField -> PrivDataField
    forall a.
    Eq a
    -> (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: PrivDataField -> PrivDataField -> Ordering
    compare :: PrivDataField -> PrivDataField -> Ordering
    $c< :: PrivDataField -> PrivDataField -> Bool
    < :: PrivDataField -> PrivDataField -> Bool
    $c<= :: PrivDataField -> PrivDataField -> Bool
    <= :: PrivDataField -> PrivDataField -> Bool
    $c> :: PrivDataField -> PrivDataField -> Bool
    > :: PrivDataField -> PrivDataField -> Bool
    $c>= :: PrivDataField -> PrivDataField -> Bool
    >= :: PrivDataField -> PrivDataField -> Bool
    $cmax :: PrivDataField -> PrivDataField -> PrivDataField
    max :: PrivDataField -> PrivDataField -> PrivDataField
    $cmin :: PrivDataField -> PrivDataField -> PrivDataField
    min :: PrivDataField -> PrivDataField -> PrivDataField
    Ord, PrivDataField -> PrivDataField -> Bool
    (PrivDataField -> PrivDataField -> Bool)
    -> (PrivDataField -> PrivDataField -> Bool) -> Eq PrivDataField
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: PrivDataField -> PrivDataField -> Bool
    == :: PrivDataField -> PrivDataField -> Bool
    $c/= :: PrivDataField -> PrivDataField -> Bool
    /= :: PrivDataField -> PrivDataField -> Bool
    Eq)

    -- | Combines a PrivDataField with a description of how to generate
    -- its value.
    data PrivDataSource
    	= PrivDataSourceFile PrivDataField FilePath
    	| PrivDataSourceFileFromCommand PrivDataField FilePath String
    	| PrivDataSource PrivDataField String

    type PrivDataSourceDesc = String

    class IsPrivDataSource s where
    	privDataField :: s -> PrivDataField
    	describePrivDataSource :: s -> Maybe PrivDataSourceDesc

    instance IsPrivDataSource PrivDataField where
    	privDataField :: PrivDataField -> PrivDataField
    privDataField = PrivDataField -> PrivDataField
    forall a. a -> a
    id
    	describePrivDataSource :: PrivDataField -> Maybe UserName
    describePrivDataSource PrivDataField
    _ = Maybe UserName
    forall a. Maybe a
    Nothing

    instance IsPrivDataSource PrivDataSource where
    	privDataField :: PrivDataSource -> PrivDataField
    privDataField PrivDataSource
    s = case PrivDataSource
    s of
    		PrivDataSourceFile PrivDataField
    f UserName
    _ -> PrivDataField
    f
    		PrivDataSourceFileFromCommand PrivDataField
    f UserName
    _ UserName
    _ -> PrivDataField
    f
    		PrivDataSource PrivDataField
    f UserName
    _ -> PrivDataField
    f
    	describePrivDataSource :: PrivDataSource -> Maybe UserName
    describePrivDataSource PrivDataSource
    s = UserName -> Maybe UserName
    forall a. a -> Maybe a
    Just (UserName -> Maybe UserName) -> UserName -> Maybe UserName
    forall a b. (a -> b) -> a -> b
    $ case PrivDataSource
    s of
    		PrivDataSourceFile PrivDataField
    _ UserName
    f -> UserName
    "< " UserName -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ UserName
    f
    		PrivDataSourceFileFromCommand PrivDataField
    _ UserName
    f UserName
    c ->
    			UserName
    "< " UserName -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ UserName
    f UserName -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ UserName
    " (created by running, for example, `" UserName -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ UserName
    c UserName -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ UserName
    "` )"
    		PrivDataSource PrivDataField
    _ UserName
    d -> UserName
    "< (" UserName -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ UserName
    d UserName -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ UserName
    ")"

    -- | A context in which a PrivDataField is used.
    --
    -- Often this will be a domain name. For example,
    -- Context "www.example.com" could be used for the SSL cert
    -- for the web server serving that domain. Multiple hosts might
    -- use that privdata.
    --
    -- This appears in serialized privdata files.
    newtype Context = Context String
    	deriving (ReadPrec [Context]
    ReadPrec Context
    Int -> ReadS Context
    ReadS [Context]
    (Int -> ReadS Context)
    -> ReadS [Context]
    -> ReadPrec Context
    -> ReadPrec [Context]
    -> Read Context
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS Context
    readsPrec :: Int -> ReadS Context
    $creadList :: ReadS [Context]
    readList :: ReadS [Context]
    $creadPrec :: ReadPrec Context
    readPrec :: ReadPrec Context
    $creadListPrec :: ReadPrec [Context]
    readListPrec :: ReadPrec [Context]
    Read, Int -> Context -> ShowS
    [Context] -> ShowS
    Context -> UserName
    (Int -> Context -> ShowS)
    -> (Context -> UserName) -> ([Context] -> ShowS) -> Show Context
    forall a.
    (Int -> a -> ShowS) -> (a -> UserName) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Context -> ShowS
    showsPrec :: Int -> Context -> ShowS
    $cshow :: Context -> UserName
    show :: Context -> UserName
    $cshowList :: [Context] -> ShowS
    showList :: [Context] -> ShowS
    Show, Eq Context
    Eq Context
    -> (Context -> Context -> Ordering)
    -> (Context -> Context -> Bool)
    -> (Context -> Context -> Bool)
    -> (Context -> Context -> Bool)
    -> (Context -> Context -> Bool)
    -> (Context -> Context -> Context)
    -> (Context -> Context -> Context)
    -> Ord Context
    Context -> Context -> Bool
    Context -> Context -> Ordering
    Context -> Context -> Context
    forall a.
    Eq a
    -> (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: Context -> Context -> Ordering
    compare :: Context -> Context -> Ordering
    $c< :: Context -> Context -> Bool
    < :: Context -> Context -> Bool
    $c<= :: Context -> Context -> Bool
    <= :: Context -> Context -> Bool
    $c> :: Context -> Context -> Bool
    > :: Context -> Context -> Bool
    $c>= :: Context -> Context -> Bool
    >= :: Context -> Context -> Bool
    $cmax :: Context -> Context -> Context
    max :: Context -> Context -> Context
    $cmin :: Context -> Context -> Context
    min :: Context -> Context -> Context
    Ord, Context -> Context -> Bool
    (Context -> Context -> Bool)
    -> (Context -> Context -> Bool) -> Eq Context
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Context -> Context -> Bool
    == :: Context -> Context -> Bool
    $c/= :: Context -> Context -> Bool
    /= :: Context -> Context -> Bool
    Eq)

    -- | A context that may vary depending on the HostName where it's used.
    newtype HostContext = HostContext { HostContext -> UserName -> Context
    mkHostContext :: HostName -> Context }

    instance Show HostContext where
    	show :: HostContext -> UserName
    show HostContext
    hc = Context -> UserName
    forall a. Show a => a -> UserName
    show (Context -> UserName) -> Context -> UserName
    forall a b. (a -> b) -> a -> b
    $ HostContext -> UserName -> Context
    mkHostContext HostContext
    hc UserName
    "<hostname>"

    instance Ord HostContext where
    	HostContext
    a <= :: HostContext -> HostContext -> Bool
    <= HostContext
    b = HostContext -> UserName
    forall a. Show a => a -> UserName
    show HostContext
    a UserName -> UserName -> Bool
    forall a. Ord a => a -> a -> Bool
    <= HostContext -> UserName
    forall a. Show a => a -> UserName
    show HostContext
    b

    instance Eq HostContext where
    	HostContext
    a == :: HostContext -> HostContext -> Bool
    == HostContext
    b = HostContext -> UserName
    forall a. Show a => a -> UserName
    show HostContext
    a UserName -> UserName -> Bool
    forall a. Eq a => a -> a -> Bool
    == HostContext -> UserName
    forall a. Show a => a -> UserName
    show HostContext
    b

    -- | Class of things that can be used as a Context.
    class IsContext c where
    	asContext :: HostName -> c -> Context
    	asHostContext :: c -> HostContext

    instance IsContext HostContext where
    	asContext :: UserName -> HostContext -> Context
    asContext = (HostContext -> UserName -> Context)
    -> UserName -> HostContext -> Context
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip HostContext -> UserName -> Context
    mkHostContext
    	asHostContext :: HostContext -> HostContext
    asHostContext = HostContext -> HostContext
    forall a. a -> a
    id

    instance IsContext Context where
    	asContext :: UserName -> Context -> Context
    asContext UserName
    _ Context
    c = Context
    c
    	asHostContext :: Context -> HostContext
    asHostContext = (UserName -> Context) -> HostContext
    HostContext ((UserName -> Context) -> HostContext)
    -> (Context -> UserName -> Context) -> Context -> HostContext
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Context -> UserName -> Context
    forall a b. a -> b -> a
    const

    -- | Use when a PrivDataField is not dependent on any paricular context.
    anyContext :: Context
    anyContext :: Context
    anyContext = UserName -> Context
    Context UserName
    "any"

    -- | Makes a HostContext that consists just of the hostname.
    hostContext :: HostContext
    hostContext :: HostContext
    hostContext = (UserName -> Context) -> HostContext
    HostContext UserName -> Context
    Context

    -- | Contains the actual private data.
    --
    -- Note that this may contain exta newlines at the end, or they may have
    -- been stripped off, depending on how the user entered the privdata,
    -- and which version of propellor stored it. Use the accessor functions
    -- below to avoid newline problems.
    newtype PrivData = PrivData String

    -- | When PrivData is the content of a file, this is the lines thereof.
    privDataLines :: PrivData -> [String]
    privDataLines :: PrivData -> [UserName]
    privDataLines (PrivData UserName
    s) = UserName -> [UserName]
    lines UserName
    s

    -- | When the PrivData is a single value, like a password, this extracts
    -- it. Note that if multiple lines are present in the PrivData, only
    -- the first is returned; there is never a newline in the String.
    privDataVal :: PrivData -> String
    privDataVal :: PrivData -> UserName
    privDataVal (PrivData UserName
    s) = UserName -> Maybe UserName -> UserName
    forall a. a -> Maybe a -> a
    fromMaybe UserName
    "" ([UserName] -> Maybe UserName
    forall a. [a] -> Maybe a
    headMaybe (UserName -> [UserName]
    lines UserName
    s))

    -- | Use to get ByteString out of PrivData.
    privDataByteString :: PrivData -> L.ByteString
    privDataByteString :: PrivData -> ByteString
    privDataByteString (PrivData UserName
    s) = UserName -> ByteString
    encodeBS UserName
    s

    data SshKeyType = SshRsa | SshDsa | SshEcdsa | SshEd25519
    	deriving (ReadPrec [SshKeyType]
    ReadPrec SshKeyType
    Int -> ReadS SshKeyType
    ReadS [SshKeyType]
    (Int -> ReadS SshKeyType)
    -> ReadS [SshKeyType]
    -> ReadPrec SshKeyType
    -> ReadPrec [SshKeyType]
    -> Read SshKeyType
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS SshKeyType
    readsPrec :: Int -> ReadS SshKeyType
    $creadList :: ReadS [SshKeyType]
    readList :: ReadS [SshKeyType]
    $creadPrec :: ReadPrec SshKeyType
    readPrec :: ReadPrec SshKeyType
    $creadListPrec :: ReadPrec [SshKeyType]
    readListPrec :: ReadPrec [SshKeyType]
    Read, Int -> SshKeyType -> ShowS
    [SshKeyType] -> ShowS
    SshKeyType -> UserName
    (Int -> SshKeyType -> ShowS)
    -> (SshKeyType -> UserName)
    -> ([SshKeyType] -> ShowS)
    -> Show SshKeyType
    forall a.
    (Int -> a -> ShowS) -> (a -> UserName) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> SshKeyType -> ShowS
    showsPrec :: Int -> SshKeyType -> ShowS
    $cshow :: SshKeyType -> UserName
    show :: SshKeyType -> UserName
    $cshowList :: [SshKeyType] -> ShowS
    showList :: [SshKeyType] -> ShowS
    Show, Eq SshKeyType
    Eq SshKeyType
    -> (SshKeyType -> SshKeyType -> Ordering)
    -> (SshKeyType -> SshKeyType -> Bool)
    -> (SshKeyType -> SshKeyType -> Bool)
    -> (SshKeyType -> SshKeyType -> Bool)
    -> (SshKeyType -> SshKeyType -> Bool)
    -> (SshKeyType -> SshKeyType -> SshKeyType)
    -> (SshKeyType -> SshKeyType -> SshKeyType)
    -> Ord SshKeyType
    SshKeyType -> SshKeyType -> Bool
    SshKeyType -> SshKeyType -> Ordering
    SshKeyType -> SshKeyType -> SshKeyType
    forall a.
    Eq a
    -> (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: SshKeyType -> SshKeyType -> Ordering
    compare :: SshKeyType -> SshKeyType -> Ordering
    $c< :: SshKeyType -> SshKeyType -> Bool
    < :: SshKeyType -> SshKeyType -> Bool
    $c<= :: SshKeyType -> SshKeyType -> Bool
    <= :: SshKeyType -> SshKeyType -> Bool
    $c> :: SshKeyType -> SshKeyType -> Bool
    > :: SshKeyType -> SshKeyType -> Bool
    $c>= :: SshKeyType -> SshKeyType -> Bool
    >= :: SshKeyType -> SshKeyType -> Bool
    $cmax :: SshKeyType -> SshKeyType -> SshKeyType
    max :: SshKeyType -> SshKeyType -> SshKeyType
    $cmin :: SshKeyType -> SshKeyType -> SshKeyType
    min :: SshKeyType -> SshKeyType -> SshKeyType
    Ord, SshKeyType -> SshKeyType -> Bool
    (SshKeyType -> SshKeyType -> Bool)
    -> (SshKeyType -> SshKeyType -> Bool) -> Eq SshKeyType
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: SshKeyType -> SshKeyType -> Bool
    == :: SshKeyType -> SshKeyType -> Bool
    $c/= :: SshKeyType -> SshKeyType -> Bool
    /= :: SshKeyType -> SshKeyType -> Bool
    Eq, Int -> SshKeyType
    SshKeyType -> Int
    SshKeyType -> [SshKeyType]
    SshKeyType -> SshKeyType
    SshKeyType -> SshKeyType -> [SshKeyType]
    SshKeyType -> SshKeyType -> SshKeyType -> [SshKeyType]
    (SshKeyType -> SshKeyType)
    -> (SshKeyType -> SshKeyType)
    -> (Int -> SshKeyType)
    -> (SshKeyType -> Int)
    -> (SshKeyType -> [SshKeyType])
    -> (SshKeyType -> SshKeyType -> [SshKeyType])
    -> (SshKeyType -> SshKeyType -> [SshKeyType])
    -> (SshKeyType -> SshKeyType -> SshKeyType -> [SshKeyType])
    -> Enum SshKeyType
    forall a.
    (a -> a)
    -> (a -> a)
    -> (Int -> a)
    -> (a -> Int)
    -> (a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> a -> [a])
    -> Enum a
    $csucc :: SshKeyType -> SshKeyType
    succ :: SshKeyType -> SshKeyType
    $cpred :: SshKeyType -> SshKeyType
    pred :: SshKeyType -> SshKeyType
    $ctoEnum :: Int -> SshKeyType
    toEnum :: Int -> SshKeyType
    $cfromEnum :: SshKeyType -> Int
    fromEnum :: SshKeyType -> Int
    $cenumFrom :: SshKeyType -> [SshKeyType]
    enumFrom :: SshKeyType -> [SshKeyType]
    $cenumFromThen :: SshKeyType -> SshKeyType -> [SshKeyType]
    enumFromThen :: SshKeyType -> SshKeyType -> [SshKeyType]
    $cenumFromTo :: SshKeyType -> SshKeyType -> [SshKeyType]
    enumFromTo :: SshKeyType -> SshKeyType -> [SshKeyType]
    $cenumFromThenTo :: SshKeyType -> SshKeyType -> SshKeyType -> [SshKeyType]
    enumFromThenTo :: SshKeyType -> SshKeyType -> SshKeyType -> [SshKeyType]
    Enum, SshKeyType
    SshKeyType -> SshKeyType -> Bounded SshKeyType
    forall a. a -> a -> Bounded a
    $cminBound :: SshKeyType
    minBound :: SshKeyType
    $cmaxBound :: SshKeyType
    maxBound :: SshKeyType
    Bounded)

    -- | Parameter that would be passed to ssh-keygen to generate key of this type
    sshKeyTypeParam :: SshKeyType -> String
    sshKeyTypeParam :: SshKeyType -> UserName
    sshKeyTypeParam SshKeyType
    SshRsa = UserName
    "RSA"
    sshKeyTypeParam SshKeyType
    SshDsa = UserName
    "DSA"
    sshKeyTypeParam SshKeyType
    SshEcdsa = UserName
    "ECDSA"
    sshKeyTypeParam SshKeyType
    SshEd25519 = UserName
    "ED25519"

    data DnsSecKey
    	= PubZSK -- ^ DNSSEC Zone Signing Key (public)
    	| PrivZSK -- ^ DNSSEC Zone Signing Key (private)
    	| PubKSK -- ^ DNSSEC Key Signing Key (public)
    	| PrivKSK -- ^ DNSSEC Key Signing Key (private)
    	deriving (ReadPrec [DnsSecKey]
    ReadPrec DnsSecKey
    Int -> ReadS DnsSecKey
    ReadS [DnsSecKey]
    (Int -> ReadS DnsSecKey)
    -> ReadS [DnsSecKey]
    -> ReadPrec DnsSecKey
    -> ReadPrec [DnsSecKey]
    -> Read DnsSecKey
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS DnsSecKey
    readsPrec :: Int -> ReadS DnsSecKey
    $creadList :: ReadS [DnsSecKey]
    readList :: ReadS [DnsSecKey]
    $creadPrec :: ReadPrec DnsSecKey
    readPrec :: ReadPrec DnsSecKey
    $creadListPrec :: ReadPrec [DnsSecKey]
    readListPrec :: ReadPrec [DnsSecKey]
    Read, Int -> DnsSecKey -> ShowS
    [DnsSecKey] -> ShowS
    DnsSecKey -> UserName
    (Int -> DnsSecKey -> ShowS)
    -> (DnsSecKey -> UserName)
    -> ([DnsSecKey] -> ShowS)
    -> Show DnsSecKey
    forall a.
    (Int -> a -> ShowS) -> (a -> UserName) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> DnsSecKey -> ShowS
    showsPrec :: Int -> DnsSecKey -> ShowS
    $cshow :: DnsSecKey -> UserName
    show :: DnsSecKey -> UserName
    $cshowList :: [DnsSecKey] -> ShowS
    showList :: [DnsSecKey] -> ShowS
    Show, Eq DnsSecKey
    Eq DnsSecKey
    -> (DnsSecKey -> DnsSecKey -> Ordering)
    -> (DnsSecKey -> DnsSecKey -> Bool)
    -> (DnsSecKey -> DnsSecKey -> Bool)
    -> (DnsSecKey -> DnsSecKey -> Bool)
    -> (DnsSecKey -> DnsSecKey -> Bool)
    -> (DnsSecKey -> DnsSecKey -> DnsSecKey)
    -> (DnsSecKey -> DnsSecKey -> DnsSecKey)
    -> Ord DnsSecKey
    DnsSecKey -> DnsSecKey -> Bool
    DnsSecKey -> DnsSecKey -> Ordering
    DnsSecKey -> DnsSecKey -> DnsSecKey
    forall a.
    Eq a
    -> (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: DnsSecKey -> DnsSecKey -> Ordering
    compare :: DnsSecKey -> DnsSecKey -> Ordering
    $c< :: DnsSecKey -> DnsSecKey -> Bool
    < :: DnsSecKey -> DnsSecKey -> Bool
    $c<= :: DnsSecKey -> DnsSecKey -> Bool
    <= :: DnsSecKey -> DnsSecKey -> Bool
    $c> :: DnsSecKey -> DnsSecKey -> Bool
    > :: DnsSecKey -> DnsSecKey -> Bool
    $c>= :: DnsSecKey -> DnsSecKey -> Bool
    >= :: DnsSecKey -> DnsSecKey -> Bool
    $cmax :: DnsSecKey -> DnsSecKey -> DnsSecKey
    max :: DnsSecKey -> DnsSecKey -> DnsSecKey
    $cmin :: DnsSecKey -> DnsSecKey -> DnsSecKey
    min :: DnsSecKey -> DnsSecKey -> DnsSecKey
    Ord, DnsSecKey -> DnsSecKey -> Bool
    (DnsSecKey -> DnsSecKey -> Bool)
    -> (DnsSecKey -> DnsSecKey -> Bool) -> Eq DnsSecKey
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: DnsSecKey -> DnsSecKey -> Bool
    == :: DnsSecKey -> DnsSecKey -> Bool
    $c/= :: DnsSecKey -> DnsSecKey -> Bool
    /= :: DnsSecKey -> DnsSecKey -> Bool
    Eq, DnsSecKey
    DnsSecKey -> DnsSecKey -> Bounded DnsSecKey
    forall a. a -> a -> Bounded a
    $cminBound :: DnsSecKey
    minBound :: DnsSecKey
    $cmaxBound :: DnsSecKey
    maxBound :: DnsSecKey
    Bounded, Int -> DnsSecKey
    DnsSecKey -> Int
    DnsSecKey -> [DnsSecKey]
    DnsSecKey -> DnsSecKey
    DnsSecKey -> DnsSecKey -> [DnsSecKey]
    DnsSecKey -> DnsSecKey -> DnsSecKey -> [DnsSecKey]
    (DnsSecKey -> DnsSecKey)
    -> (DnsSecKey -> DnsSecKey)
    -> (Int -> DnsSecKey)
    -> (DnsSecKey -> Int)
    -> (DnsSecKey -> [DnsSecKey])
    -> (DnsSecKey -> DnsSecKey -> [DnsSecKey])
    -> (DnsSecKey -> DnsSecKey -> [DnsSecKey])
    -> (DnsSecKey -> DnsSecKey -> DnsSecKey -> [DnsSecKey])
    -> Enum DnsSecKey
    forall a.
    (a -> a)
    -> (a -> a)
    -> (Int -> a)
    -> (a -> Int)
    -> (a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> a -> [a])
    -> Enum a
    $csucc :: DnsSecKey -> DnsSecKey
    succ :: DnsSecKey -> DnsSecKey
    $cpred :: DnsSecKey -> DnsSecKey
    pred :: DnsSecKey -> DnsSecKey
    $ctoEnum :: Int -> DnsSecKey
    toEnum :: Int -> DnsSecKey
    $cfromEnum :: DnsSecKey -> Int
    fromEnum :: DnsSecKey -> Int
    $cenumFrom :: DnsSecKey -> [DnsSecKey]
    enumFrom :: DnsSecKey -> [DnsSecKey]
    $cenumFromThen :: DnsSecKey -> DnsSecKey -> [DnsSecKey]
    enumFromThen :: DnsSecKey -> DnsSecKey -> [DnsSecKey]
    $cenumFromTo :: DnsSecKey -> DnsSecKey -> [DnsSecKey]
    enumFromTo :: DnsSecKey -> DnsSecKey -> [DnsSecKey]
    $cenumFromThenTo :: DnsSecKey -> DnsSecKey -> DnsSecKey -> [DnsSecKey]
    enumFromThenTo :: DnsSecKey -> DnsSecKey -> DnsSecKey -> [DnsSecKey]
    Enum)