| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Codec.Encryption.OpenPGP.Serialize
Synopsis
- putPkt :: Pkt -> Put
- putPktEither :: Pkt -> Either String Put
- putSKAddendum :: SKAddendum -> Either String Put
- getSecretKey :: SomePKPayload -> Get SKey
- putSKeyForPKPayload :: SomePKPayload -> SKey -> Either String Put
- dearmorIfAsciiArmored :: ByteString -> Either String (Bool, ByteString)
- dearmorIfAsciiArmoredLenient :: ByteString -> Either String (Bool, ByteString)
- looksLikeAsciiArmor :: ByteString -> Bool
- armorPayloadsOfType :: ArmorType -> [Armor] -> [ByteString]
- singleArmorPayloadOfType :: ArmorType -> [Armor] -> Either String ByteString
- singleClearSignedBlock :: [Armor] -> Either String ([(String, String)], ByteString, ByteString)
- recommendedArmorType :: [Pkt] -> Maybe ArmorType
- data WireRepInput = WireRepInput {}
- wireRepRefFromInput :: Maybe Text -> ByteString -> Either String WireRepInput
- data PktParseError = PktParseError {}
- parsePkts :: ByteString -> [Pkt]
- parsePktsEither :: ByteString -> Either PktParseError [Pkt]
- parsePktsWithWireRep :: WireRepRef -> ByteString -> [PktWithWireRep]
- conduitParsePktsWithWireRep :: forall (m :: Type -> Type). Monad m => Maybe Text -> ConduitT ByteString PktWithWireRep m ()
Serialization functions
putPktEither :: Pkt -> Either String Put Source #
Serialize a packet with explicit validation and error handling. Validates constraints before calling putPkt to ensure errors are caught early.
putSKAddendum :: SKAddendum -> Either String Put Source #
getSecretKey :: SomePKPayload -> Get SKey Source #
putSKeyForPKPayload :: SomePKPayload -> SKey -> Either String Put Source #
Utilities
dearmorIfAsciiArmored :: ByteString -> Either String (Bool, ByteString) Source #
looksLikeAsciiArmor :: ByteString -> Bool Source #
armorPayloadsOfType :: ArmorType -> [Armor] -> [ByteString] Source #
singleArmorPayloadOfType :: ArmorType -> [Armor] -> Either String ByteString Source #
singleClearSignedBlock :: [Armor] -> Either String ([(String, String)], ByteString, ByteString) Source #
data WireRepInput Source #
Constructors
| WireRepInput | |
Fields | |
data PktParseError Source #
Constructors
| PktParseError | |
Fields | |
Instances
| Show PktParseError Source # | |
Defined in Codec.Encryption.OpenPGP.Serialize | |
| Eq PktParseError Source # | |
Defined in Codec.Encryption.OpenPGP.Serialize Methods (==) :: PktParseError -> PktParseError -> Bool Source # (/=) :: PktParseError -> PktParseError -> Bool Source # | |
parsePkts :: ByteString -> [Pkt] Source #
Parse the packets from a ByteString, with no error reporting
parsePktsEither :: ByteString -> Either PktParseError [Pkt] Source #
Parse packets from a ByteString and report the first parse failure.
parsePktsWithWireRep :: WireRepRef -> ByteString -> [PktWithWireRep] Source #
Parse packets from a source bytestream, preserving packet provenance.
conduitParsePktsWithWireRep :: forall (m :: Type -> Type). Monad m => Maybe Text -> ConduitT ByteString PktWithWireRep m () Source #