License | Public Domain |
---|---|
Maintainer | daveparrish@tutanota.com |
Stability | experimental |
Portability | untested |
Safe Haskell | None |
Language | Haskell2010 |
Key generation for h-gpgme.
It is suggested to import as qualified. For example:
import qualified Crypto.Gpgme.Key.Gen as G
- genKey :: Ctx -> GenKeyParams -> IO (Either GpgmeError Fpr)
- data GenKeyParams = GenKeyParams {
- keyType :: Maybe PubKeyAlgo
- keyLength :: Maybe BitSize
- keyGrip :: ByteString
- keyUsage :: Maybe UsageList
- subkeyType :: Maybe PubKeyAlgo
- subkeyLength :: Maybe BitSize
- passphrase :: ByteString
- nameReal :: ByteString
- nameComment :: ByteString
- nameEmail :: Maybe EmailAddress
- expireDate :: Maybe ExpireDate
- creationDate :: Maybe CreationDate
- preferences :: ByteString
- revoker :: ByteString
- keyserver :: ByteString
- handle :: ByteString
- rawParams :: ByteString
- data BitSize
- bitSize :: Int -> Either String BitSize
- data UsageList = UsageList {}
- data Encrypt = Encrypt
- data Sign = Sign
- data Auth = Auth
- data ExpireDate
- data CreationDate
- data Positive
- toPositive :: Int -> Maybe Positive
- toParamsString :: GenKeyParams -> ByteString
Usage
:: Ctx | context to operate in |
-> GenKeyParams | parameters to use for generating key |
-> IO (Either GpgmeError Fpr) |
Generate a GPG key
Parameters
data GenKeyParams Source #
Key generation parameters.
See: https://www.gnupg.org/documentation/manuals/gnupg/Unattended-GPG-key-generation.html
GenKeyParams | |
|
Default GenKeyParams Source # | Default parameters Intended to be used to build custom paramemters. params = (def :: GenKeyParams) { keyType = Just Dsa } See tests for working example of all parameters in use. |
BitSize
UsageList
ExpireDate
data ExpireDate Source #
Expire-Date parameter
Beware, genKey
will not check that ExpireDate is after
CreationDate of generated key.
CreationDate
data CreationDate Source #
Creation-Date parameter
Other
toPositive :: Int -> Maybe Positive Source #
Create a Positive type as long as the Int is greater than -1
toParamsString :: GenKeyParams -> ByteString Source #
Used by genKey
generate a XML string for GPG