cryptostore-0.3.1.0: Serialization of cryptographic data types
LicenseBSD-style
MaintainerOlivier Chéron <olivier.cheron@gmail.com>
Stabilityexperimental
Portabilityunknown
Safe HaskellSafe-Inferred
LanguageHaskell2010

Crypto.Store.X509

Description

Public keys, certificates and CRLs.

Presents an API similar to Data.X509.Memory and Data.X509.File but provides support for public-key files and allows to write objects.

Functions related to private keys are available from Crypto.Store.PKCS8.

Synopsis

Documentation

class (ASN1Object a, Eq a, Show a) => SignedObject a Source #

Class of signed objects convertible to PEM.

Minimal complete definition

signedObjectName, otherObjectNames

Instances

Instances details
SignedObject CRL Source # 
Instance details

Defined in Crypto.Store.X509

Methods

signedObjectName :: proxy CRL -> String

otherObjectNames :: proxy CRL -> [String]

SignedObject Certificate Source # 
Instance details

Defined in Crypto.Store.X509

Public keys

readPubKeyFile :: FilePath -> IO [PubKey] Source #

Read public keys from a PEM file.

readPubKeyFileFromMemory :: ByteString -> [PubKey] Source #

Read public keys from a bytearray in PEM format.

pemToPubKey :: [Maybe PubKey] -> PEM -> [Maybe PubKey] Source #

Read a public key from a PEM element and add it to the accumulator list.

writePubKeyFile :: FilePath -> [PubKey] -> IO () Source #

Write public keys to a PEM file.

writePubKeyFileToMemory :: [PubKey] -> ByteString Source #

Write public keys to a bytearray in PEM format.

pubKeyToPEM :: PubKey -> PEM Source #

Generate a PEM for a public key.

Signed objects

readSignedObject :: SignedObject a => FilePath -> IO [SignedExact a] Source #

Read signed objects from a PEM file (only one type at a time).

readSignedObjectFromMemory :: SignedObject a => ByteString -> [SignedExact a] Source #

Read signed objects from a bytearray in PEM format (only one type at a time).

writeSignedObject :: SignedObject a => FilePath -> [SignedExact a] -> IO () Source #

Write signed objects to a PEM file.

writeSignedObjectToMemory :: SignedObject a => [SignedExact a] -> ByteString Source #

Write signed objects to a bytearray in PEM format.

Reading and writing PEM files

readPEMs :: FilePath -> IO [PEM] Source #

Read a PEM file from disk.

writePEMs :: FilePath -> [PEM] -> IO () Source #

Write a PEM file to disk.