h-gpgme-0.5.1.0: High Level Binding for GnuPG Made Easy (gpgme)

LicensePublic Domain
Maintainerdaveparrish@tutanota.com
Stabilityexperimental
Portabilityuntested
Safe HaskellNone
LanguageHaskell2010

Crypto.Gpgme.Key.Gen

Contents

Description

Key generation for h-gpgme.

It is suggested to import as qualified. For example:

import qualified  Crypto.Gpgme.Key.Gen as G

Synopsis

Usage

genKey Source #

Arguments

:: Ctx

context to operate in

-> GenKeyParams

parameters to use for generating key

-> IO (Either GpgmeError Fpr) 

Generate a GPG key

Parameters

data GenKeyParams Source #

Instances

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.

Methods

def :: GenKeyParams #

BitSize

data BitSize Source #

Key-Length parameter

bitSize :: Int -> Either String BitSize Source #

Bit size constrained to 1024-4096 bits

UsageList

data UsageList Source #

Constructors

UsageList 

Instances

Default UsageList Source #

Default UsageList

Intended to be used to build custom UsageList parameter

usageListParam = (def :: UsageList) (Just Encrypt)

See tests for working example of all parameters in use.

Methods

def :: UsageList #

data Encrypt Source #

Constructors

Encrypt 

data Sign Source #

Constructors

Sign 

data Auth Source #

Constructors

Auth 

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

Constructors

CreationT UTCTime 
CreationS Positive

Seconds since epoch

Other

data Positive Source #

Only a positive Int

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