hOpenPGP-3.6.1: native Haskell implementation of OpenPGP (RFC9580)
Safe HaskellNone
LanguageHaskell2010

Codec.Encryption.OpenPGP.Signing

Description

High-level signing monad transformer for OpenPGP.

SigningT wraps a TK SecretTK and provides a unified interface for creating signatures with any signing-capable subkey or the primary key.

It handles key selection, payload construction and signature generation.

Synopsis

SigningT transformer

data SigningT (tk :: TKKind) (m :: Type -> Type) a Source #

The signing monad transformer.

Instances

Instances details
Monad m => Applicative (SigningT tk m) Source # 
Instance details

Defined in Codec.Encryption.OpenPGP.Signing

Methods

pure :: a -> SigningT tk m a Source #

(<*>) :: SigningT tk m (a -> b) -> SigningT tk m a -> SigningT tk m b Source #

liftA2 :: (a -> b -> c) -> SigningT tk m a -> SigningT tk m b -> SigningT tk m c Source #

(*>) :: SigningT tk m a -> SigningT tk m b -> SigningT tk m b Source #

(<*) :: SigningT tk m a -> SigningT tk m b -> SigningT tk m a Source #

Functor m => Functor (SigningT tk m) Source # 
Instance details

Defined in Codec.Encryption.OpenPGP.Signing

Methods

fmap :: (a -> b) -> SigningT tk m a -> SigningT tk m b Source #

(<$) :: a -> SigningT tk m b -> SigningT tk m a Source #

Monad m => Monad (SigningT tk m) Source # 
Instance details

Defined in Codec.Encryption.OpenPGP.Signing

Methods

(>>=) :: SigningT tk m a -> (a -> SigningT tk m b) -> SigningT tk m b Source #

(>>) :: SigningT tk m a -> SigningT tk m b -> SigningT tk m b Source #

return :: a -> SigningT tk m a Source #

runSigningT Source #

Arguments

:: Monad m 
=> TK 'SecretTK

The secret transferable key to sign with

-> ThirtyTwoBitTimeStamp

Initial timestamp

-> SigningT 'SecretTK m a

Action to run

-> m (Either SigningError a) 

Run a SigningT action.

Signing target selection

data AvailableSigner Source #

A signing-capable key extracted from a TK.

listAvailableSigners :: TK 'SecretTK -> [AvailableSigner] Source #

List all signing-capable keys from a TK SecretTK.

filterSigningCapable :: [AvailableSigner] -> [AvailableSigner] Source #

Filter to only signing-capable keys.

Signing payloads

Low-level signing

signWith :: forall (m :: Type -> Type). MonadRandom m => SigningTarget -> SigningPayload -> SigningT 'SecretTK m (Either SigningError SignaturePayload) Source #

Sign an arbitrary payload with a selected key.

High-level signing operations

signUserId :: forall (m :: Type -> Type). MonadRandom m => SigType -> UserId -> SigningT 'SecretTK m (Either SigningError SignaturePayload) Source #

Sign a user ID with the primary key.

signUat :: forall (m :: Type -> Type). MonadRandom m => SigType -> UserAttribute -> SigningT 'SecretTK m (Either SigningError SignaturePayload) Source #

Sign a user attribute with the primary key.

Timestamp control

getCurrentTimestamp :: forall (m :: Type -> Type) (tk :: TKKind). Monad m => SigningT tk m ThirtyTwoBitTimeStamp Source #

Get the current signing timestamp.

setCurrentTimestamp :: forall (m :: Type -> Type) (tk :: TKKind). Monad m => ThirtyTwoBitTimeStamp -> SigningT tk m () Source #

Set the current signing timestamp.

withTimestamp :: forall (m :: Type -> Type) (tk :: TKKind) a. Monad m => ThirtyTwoBitTimeStamp -> SigningT tk m a -> SigningT tk m a Source #

Execute an action with a specific timestamp.