| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Codec.Encryption.OpenPGP.Compression
Synopsis
- data CompressionError
- renderCompressionError :: CompressionError -> String
- decompressPkt :: Pkt -> Either CompressionError [Pkt]
- compressPkts :: CompressionAlgorithm -> [Pkt] -> Pkt
Documentation
data CompressionError Source #
Errors that can arise during decompression of an OpenPGP Compressed Data
packet. Note that corrupt stream exceptions from the underlying
zlib/bzip2 library are not captured here; they propagate as IOException
through the call stack.
Constructors
| EmptyCompressedPayload CompressionAlgorithm | The compressed payload bytes are empty; nothing to decompress. |
| InnerPacketParseFailed CompressionAlgorithm String | Decompression succeeded but the binary parse of the inner packet sequence failed. |
| ZeroLengthDecompressedPayload CompressionAlgorithm | Decompression and parse succeeded but produced no packets at all (zero-length uncompressed payload). |
| MarkerOnlyPayload CompressionAlgorithm | The decompressed content contains only Marker packets (RFC4880 §5.8 marker packets carry no semantic content). |
Instances
| Show CompressionError Source # | |
Defined in Codec.Encryption.OpenPGP.Compression | |
| Eq CompressionError Source # | |
Defined in Codec.Encryption.OpenPGP.Compression Methods (==) :: CompressionError -> CompressionError -> Bool Source # (/=) :: CompressionError -> CompressionError -> Bool Source # | |
decompressPkt :: Pkt -> Either CompressionError [Pkt] Source #
Decompress an OpenPGP Compressed Data packet, classifying structural
failures as CompressionError. Non-Compressed-Data packets are returned
unchanged in Right [p]. Corrupt compressed streams may still throw
IOException from the underlying decompression library.
compressPkts :: CompressionAlgorithm -> [Pkt] -> Pkt Source #