openpgp-0.6.1: Implementation of the OpenPGP message format

Safe HaskellNone

Data.OpenPGP

Description

Main implementation of the OpenPGP message format http://tools.ietf.org/html/rfc4880

The recommended way to import this module is:

 import qualified Data.OpenPGP as OpenPGP

Synopsis

Documentation

data Packet Source

Constructors

AsymmetricSessionKeyPacket

http://tools.ietf.org/html/rfc4880#section-5.1

SymmetricSessionKeyPacket

http://tools.ietf.org/html/rfc4880#section-5.3

Fields

version :: Word8
 
symmetric_algorithm :: SymmetricAlgorithm
 
s2k :: S2K

This is meaningless if symmetric_algorithm == Unencrypted

encrypted_data :: ByteString
 
OnePassSignaturePacket

http://tools.ietf.org/html/rfc4880#section-5.4

PublicKeyPacket

http://tools.ietf.org/html/rfc4880#section-5.5.1.1 (also subkey)

SecretKeyPacket

http://tools.ietf.org/html/rfc4880#section-5.5.1.3 (also subkey)

Fields

version :: Word8
 
timestamp :: Word32
 
key_algorithm :: KeyAlgorithm
 
key :: [(Char, MPI)]
 
s2k_useage :: Word8
 
s2k :: S2K

This is meaningless if symmetric_algorithm == Unencrypted

symmetric_algorithm :: SymmetricAlgorithm
 
encrypted_data :: ByteString
 
is_subkey :: Bool
 
CompressedDataPacket

http://tools.ietf.org/html/rfc4880#section-5.6

MarkerPacket

http://tools.ietf.org/html/rfc4880#section-5.8

LiteralDataPacket

http://tools.ietf.org/html/rfc4880#section-5.9

TrustPacket ByteString

http://tools.ietf.org/html/rfc4880#section-5.10

UserIDPacket String

http://tools.ietf.org/html/rfc4880#section-5.11

EncryptedDataPacket

http://tools.ietf.org/html/rfc4880#section-5.13 or http://tools.ietf.org/html/rfc4880#section-5.7 when version is 0

ModificationDetectionCodePacket ByteString

http://tools.ietf.org/html/rfc4880#section-5.14

UnsupportedPacket Word8 ByteString 

signaturePacketSource

Arguments

:: Word8

Signature version (probably 4)

-> Word8

Signature type http://tools.ietf.org/html/rfc4880#section-5.2.1

-> KeyAlgorithm 
-> HashAlgorithm 
-> [SignatureSubpacket]

Hashed subpackets (these get signed)

-> [SignatureSubpacket]

Unhashed subpackets (these do not get signed)

-> Word16

Left 16 bits of the signed hash value

-> [MPI]

The raw MPIs of the signature

-> Packet 

SignaturePacket smart constructor

http://tools.ietf.org/html/rfc4880#section-5.2

newtype Message Source

A message is encoded as a list that takes the entire file

Constructors

Message [Packet] 

data SignatureSubpacket Source

string2key :: (HashAlgorithm -> ByteString -> ByteString) -> S2K -> ByteString -> ByteStringSource

Take a hash function and an S2K value and generate the bytes needed for creating a symmetric key.

Return value is always infinite length. Take the first n bytes you need for your keysize.

find_keySource

Arguments

:: (Packet -> String)

Extract Fingerprint/KeyID from packet

-> Message

List of packets (some of which are keys)

-> String

Fingerprint/KeyID to search for

-> Maybe Packet 

Find a key with the given Fingerprint/KeyID

fingerprint_material :: Packet -> [ByteString]Source

Helper method for fingerprints and such

signatures :: Message -> [SignatureOver]Source

Extract signed objects from a well-formatted message

Recurses into CompressedDataPacket

http://tools.ietf.org/html/rfc4880#section-11

signature_issuer :: Packet -> Maybe StringSource

Find the keyid that issued a SignaturePacket