| Copyright | (c) 2023 Tim Emiola |
|---|---|
| License | BSD3 |
| Maintainer | Tim Emiola <adetokunbo@emio.la> |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Test.Certs.Temp
Description
Enables configuration and generation of temporary certificates
Synopsis
- withCertPaths :: FilePath -> Config -> (CertPaths -> IO a) -> IO a
- withCertFilenames :: (FilePath -> CertPaths) -> FilePath -> Config -> (CertPaths -> IO a) -> IO a
- withCertPathsInTmp :: Config -> (CertPaths -> IO a) -> IO a
- withCertPathsInTmp' :: (CertPaths -> IO a) -> IO a
- generateAndStore :: CertPaths -> Config -> IO ()
- data Config = Config {
- cCommonName :: !Text
- cDurationDays :: !Natural
- cProvince :: !(Maybe Text)
- cCity :: !(Maybe Text)
- cOrganization :: !(Maybe Text)
- cCountry :: !(Maybe Text)
- defaultConfig :: Config
- data CertPaths = CertPaths {}
- keyPath :: CertPaths -> FilePath
- certificatePath :: CertPaths -> FilePath
generate certificates
withCertPaths :: FilePath -> Config -> (CertPaths -> IO a) -> IO a Source #
Create certificates in a temporary directory below parentDir, specify the
locations using CertPaths, use them, then delete them
withCertFilenames :: (FilePath -> CertPaths) -> FilePath -> Config -> (CertPaths -> IO a) -> IO a Source #
Like withCertPaths, but allows the CertPath filenames to be specified
withCertPathsInTmp :: Config -> (CertPaths -> IO a) -> IO a Source #
Like withCertPaths with the system TEMP dir as the parentDir
withCertPathsInTmp' :: (CertPaths -> IO a) -> IO a Source #
Like withCertPathsInTmp using a default Config
generateAndStore :: CertPaths -> Config -> IO () Source #
Generate and store certificate files as specified as CertPaths
configuration
Configure some details of the generated certificates
Constructors
| Config | |
Fields
| |
defaultConfig :: Config Source #
A default value for : CN=localhost, duration is 365 days.Config
certificate filenames
Specifies the location to write the temporary certificates
Constructors
| CertPaths | |
certificatePath :: CertPaths -> FilePath Source #
The path of the generated certificate file