summaryrefslogtreecommitdiff
path: root/src/Propellor/Types/PrivData.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Types/PrivData.hs')
-rw-r--r--src/Propellor/Types/PrivData.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Propellor/Types/PrivData.hs b/src/Propellor/Types/PrivData.hs
index c72838cb..98cdb7a1 100644
--- a/src/Propellor/Types/PrivData.hs
+++ b/src/Propellor/Types/PrivData.hs
@@ -2,8 +2,10 @@ 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!
@@ -110,6 +112,10 @@ privDataLines (PrivData s) = lines s
privDataVal :: PrivData -> String
privDataVal (PrivData s) = fromMaybe "" (headMaybe (lines s))
+-- | Use to get ByteString out of PrivData.
+privDataByteString :: PrivData -> L.ByteString
+privDataByteString (PrivData s) = encodeBS s
+
data SshKeyType = SshRsa | SshDsa | SshEcdsa | SshEd25519
deriving (Read, Show, Ord, Eq, Enum, Bounded)