| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Codec.Encryption.OpenPGP.Encrypt
Synopsis
- data PKESKEncryptError
- = UnsupportedSessionKeyAlgorithm SymmetricAlgorithm String
- | InvalidSessionKeyLength SymmetricAlgorithm Int Int
- | InvalidRecipientIdentifier String
- | UnsupportedRecipientAlgorithm PubKeyAlgorithm
- | InvalidRecipientKeyMaterial PubKeyAlgorithm String
- | RecipientKdfFailure PubKeyAlgorithm String
- | RecipientKeyWrapFailure PubKeyAlgorithm String
- | RecipientCapabilitySelectionFailure RecipientCapabilityError
- | PayloadBuildFailure String
- | NoRecipientsProvided
- data RecipientCapabilityNegotiationMode
- data RecipientCapabilityError
- = RecipientCapabilityMissingEncryptionFlags SomePKPayload (Set KeyFlag)
- | RecipientCapabilityNoEncryptableKeyMaterialInTK
- | RecipientCapabilityMissingSEIPDv1Support [SomePKPayload]
- | RecipientCapabilityMissingSEIPDv2Support [SomePKPayload]
- | RecipientCapabilityNoCommonSymmetricAlgorithms [SymmetricAlgorithm]
- | RecipientCapabilityNoCommonAEADAlgorithms [AEADAlgorithm]
- renderRecipientCapabilityError :: RecipientCapabilityError -> String
- data RecipientCapabilities = RecipientCapabilities {
- recipientCapabilityKeyVersion :: KeyVersion
- recipientCapabilityPublicKeyAlgorithm :: PubKeyAlgorithm
- recipientCapabilityKeyFlags :: Set KeyFlag
- recipientCapabilityFeatures :: Set FeatureFlag
- recipientCapabilityPreferredSymmetricAlgorithms :: [SymmetricAlgorithm]
- recipientCapabilityPreferredAEADAlgorithms :: [AEADAlgorithm]
- recipientCapabilitiesFromSubpacketPayloads :: SomePKPayload -> [SigSubPacketPayload] -> RecipientCapabilities
- recipientCapabilitySupportsEncryption :: RecipientCapabilities -> Bool
- data RecipientTargetRejectionReason
- data RecipientEncryptionTargetRejected = RecipientEncryptionTargetRejected {}
- data RecipientEncryptionTargetsReport = RecipientEncryptionTargetsReport {}
- recipientEncryptionTargetsReportFromTKAtTimestamp :: ThirtyTwoBitTimeStamp -> TKUnknown -> RecipientEncryptionTargetsReport
- recipientEncryptionTargetsReportFromTK :: TK 'PublicTK -> RecipientEncryptionTargetsReport
- recipientEncryptionTargetFromTKAtTimestamp :: ThirtyTwoBitTimeStamp -> TKUnknown -> Either RecipientCapabilityError RecipientEncryptionTarget
- recipientEncryptionTargetFromTKAtTimestampWithPolicy :: RecipientTargetSelectionPolicy -> ThirtyTwoBitTimeStamp -> TKUnknown -> Either RecipientCapabilityError RecipientEncryptionTarget
- recipientEncryptionTargetsFromTKAtTimestamp :: ThirtyTwoBitTimeStamp -> TKUnknown -> [RecipientEncryptionTarget]
- recipientEncryptionTargetFromTK :: TK 'PublicTK -> Either RecipientCapabilityError RecipientEncryptionTarget
- recipientEncryptionTargetFromTKWithPolicy :: RecipientTargetSelectionPolicy -> TK 'PublicTK -> Either RecipientCapabilityError RecipientEncryptionTarget
- recipientEncryptionTargetsFromTK :: TK 'PublicTK -> [RecipientEncryptionTarget]
- data RecipientTargetSelectionPolicy
- data PassphraseSKESKVersionPolicy
- data PassphraseEncryptRequest = PassphraseEncryptRequest {
- passphraseEncryptVersionPolicy :: PassphraseSKESKVersionPolicy
- passphraseEncryptSymmetricAlgorithm :: SymmetricAlgorithm
- passphraseEncryptS2K :: S2K
- passphraseEncryptPassphrase :: ByteString
- passphraseEncryptPayload :: ByteString
- passphraseEncryptSEIPDv1IVOverride :: Maybe IV
- passphraseEncryptSEIPDv2AEADOverride :: Maybe AEADAlgorithm
- passphraseEncryptSEIPDv2ChunkSizeOverride :: Maybe Word8
- passphraseEncryptSEIPDv2SaltOverride :: Maybe Salt
- encryptPassphraseWithPolicy :: MonadRandom m => PassphraseEncryptRequest -> m (Either String [Pkt])
- data PKESKVersionPolicy
- data RecipientPKESKVersionStrategy
- data RecipientPKESKVersionStrategyW (strategy :: RecipientPKESKVersionStrategy) where
- data SomeRecipientPKESKVersionStrategyW where
- SomeRecipientPKESKVersionStrategyW :: forall (strategy :: RecipientPKESKVersionStrategy). RecipientPKESKVersionStrategyW strategy -> SomeRecipientPKESKVersionStrategyW
- type RecipientPKESKVersionSelector = SomePKPayload -> Either PKESKEncryptError RecipientPKESKVersionStrategy
- type RecipientPKESKVersionSelectorTyped = SomePKPayload -> Either PKESKEncryptError SomeRecipientPKESKVersionStrategyW
- data EncryptCompatibilityProfile
- data EncryptCompatibilityProfileW (profile :: EncryptCompatibilityProfile) where
- data SomeEncryptCompatibilityProfileW where
- SomeEncryptCompatibilityProfileW :: forall (profile :: EncryptCompatibilityProfile). EncryptCompatibilityProfileW profile -> SomeEncryptCompatibilityProfileW
- data RecipientEncryptionTarget = RecipientEncryptionTarget {}
- recipientEncryptionTarget :: SomePKPayload -> RecipientEncryptionTarget
- recipientEncryptionTargetWithStrategy :: SomePKPayload -> RecipientPKESKVersionStrategy -> RecipientEncryptionTarget
- recipientEncryptionTargetWithCapabilities :: SomePKPayload -> RecipientCapabilities -> RecipientEncryptionTarget
- recipientEncryptionTargetWithStrategyTyped :: forall (strategy :: RecipientPKESKVersionStrategy). SomePKPayload -> RecipientPKESKVersionStrategyW strategy -> RecipientEncryptionTarget
- recipientVersionStrategyForProfile :: EncryptCompatibilityProfile -> RecipientEncryptionTarget -> Either PKESKEncryptError RecipientPKESKVersionStrategy
- recipientVersionStrategyForProfileTyped :: forall (profile :: EncryptCompatibilityProfile). EncryptCompatibilityProfileW profile -> RecipientEncryptionTarget -> Either PKESKEncryptError SomeRecipientPKESKVersionStrategyW
- data RecipientPayloadShape = RecipientPayloadShape {}
- defaultRecipientPayloadShape :: RecipientPayloadShape
- data SEIPDVersion
- data RecipientEncryptResult = RecipientEncryptResult {}
- data RecipientEncryptRequest (v :: SEIPDVersion) = RecipientEncryptRequest {
- recipientEncryptRequestTargets :: [RecipientEncryptionTarget]
- recipientEncryptRequestPayloadShape :: RecipientPayloadShape
- recipientEncryptRequestPayload :: ByteString
- recipientEncryptRequestSymmetricOverride :: Maybe SymmetricAlgorithm
- recipientEncryptRequestOverrides :: RecipientEncryptRequestOverrides v
- data RecipientEncryptRequestOverrides (v :: SEIPDVersion) where
- encryptForRecipients :: forall m (v :: SEIPDVersion). MonadRandom m => RecipientEncryptRequest v -> m (Either PKESKEncryptError RecipientEncryptResult)
- encryptForRecipientsLegacy :: forall m (v :: SEIPDVersion). MonadRandom m => RecipientEncryptRequest v -> m (Either PKESKEncryptError RecipientEncryptResult)
- encryptForRecipientsWithCapabilityNegotiation :: forall m (v :: SEIPDVersion). MonadRandom m => RecipientCapabilityNegotiationMode -> RecipientEncryptRequest v -> m (Either PKESKEncryptError RecipientEncryptResult)
- data PKESKV3SessionMaterial
- data PKESKV6RawSessionMaterial
- data PKESKSessionMaterial
- pkeskSessionAlgorithm :: PKESKSessionMaterial -> SymmetricAlgorithm
- pkeskSessionKey :: PKESKSessionMaterial -> SessionKey
- mkPKESKSessionMaterial :: SymmetricAlgorithm -> SessionKey -> Either PKESKEncryptError PKESKSessionMaterial
- mkPKESKV3SessionMaterial :: SymmetricAlgorithm -> SessionKey -> Either PKESKEncryptError PKESKV3SessionMaterial
- mkPKESKV6RawSessionMaterial :: SymmetricAlgorithm -> SessionKey -> Either PKESKEncryptError PKESKV6RawSessionMaterial
- pkeskV3SessionMaterial :: PKESKSessionMaterial -> PKESKV3SessionMaterial
- pkeskV6RawSessionMaterial :: PKESKSessionMaterial -> PKESKV6RawSessionMaterial
- encodeOpenPGPSessionMaterial :: SymmetricAlgorithm -> SessionKey -> Either PKESKEncryptError ByteString
- generateSessionKeyMaterial :: MonadRandom m => SymmetricAlgorithm -> m (Either PKESKEncryptError PKESKSessionMaterial)
- canonicalizePKESKRecipientId :: PKESKPayload -> Either PKESKEncryptError PKESKPayload
- canonicalizePKESKPacketRecipientIds :: [Pkt] -> Either PKESKEncryptError [Pkt]
- buildPKESKv3PayloadForRecipient :: MonadRandom m => SomePKPayload -> PKESKV3SessionMaterial -> m (Either PKESKEncryptError PKESKPayload)
- buildPKESKv3PktForRecipient :: MonadRandom m => SomePKPayload -> PKESKV3SessionMaterial -> m (Either PKESKEncryptError Pkt)
- buildPKESKPayloadForRecipient :: MonadRandom m => PKESKVersionPolicy -> SomePKPayload -> PKESKSessionMaterial -> m (Either PKESKEncryptError PKESKPayload)
- buildPKESKPktForRecipient :: MonadRandom m => PKESKVersionPolicy -> SomePKPayload -> PKESKSessionMaterial -> m (Either PKESKEncryptError Pkt)
- buildPKESKPktsForRecipientTargetsWithSelector :: MonadRandom m => (RecipientEncryptionTarget -> Either PKESKEncryptError RecipientPKESKVersionStrategy) -> [RecipientEncryptionTarget] -> PKESKSessionMaterial -> m (Either PKESKEncryptError [Pkt])
- buildPKESKPktsForRecipientTargetsWithSelectorTyped :: MonadRandom m => (RecipientEncryptionTarget -> Either PKESKEncryptError SomeRecipientPKESKVersionStrategyW) -> [RecipientEncryptionTarget] -> PKESKSessionMaterial -> m (Either PKESKEncryptError [Pkt])
- encryptSEIPDv2Payload :: SymmetricAlgorithm -> AEADAlgorithm -> Word8 -> Salt -> SessionKey -> ByteString -> Either String ByteString
- encryptSEIPDv1Payload :: SymmetricAlgorithm -> IV -> SessionKey -> ByteString -> Either String ByteString
- encryptSEIPDv2WithSKESK :: SymmetricAlgorithm -> AEADAlgorithm -> Word8 -> Salt -> S2K -> ByteString -> ByteString -> Either String [Pkt]
- encryptSEIPDv2WithSKESKBlock :: SymmetricAlgorithm -> AEADAlgorithm -> Word8 -> Salt -> S2K -> ByteString -> Block Pkt -> Either String [Pkt]
- encryptSEIPDv2LiteralDataWithSKESK :: SymmetricAlgorithm -> AEADAlgorithm -> Word8 -> Salt -> S2K -> ByteString -> ByteString -> Either String [Pkt]
- composeMessageWithSEIPDv2 :: SymmetricAlgorithm -> AEADAlgorithm -> Word8 -> Salt -> S2K -> ByteString -> ByteString -> Maybe [Pkt] -> Either String [Pkt]
Documentation
data PKESKEncryptError Source #
Typed failures surfaced by encrypt-side PKESK and SEIPD-v2 helpers.
Constructors
Instances
| Show PKESKEncryptError Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt | |
| Eq PKESKEncryptError Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt Methods (==) :: PKESKEncryptError -> PKESKEncryptError -> Bool Source # (/=) :: PKESKEncryptError -> PKESKEncryptError -> Bool Source # | |
data RecipientCapabilityError Source #
Constructors
Instances
| Show RecipientCapabilityError Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt | |
| Eq RecipientCapabilityError Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt Methods (==) :: RecipientCapabilityError -> RecipientCapabilityError -> Bool Source # (/=) :: RecipientCapabilityError -> RecipientCapabilityError -> Bool Source # | |
data RecipientCapabilities Source #
Constructors
Instances
| Show RecipientCapabilities Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt | |
| Eq RecipientCapabilities Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt Methods (==) :: RecipientCapabilities -> RecipientCapabilities -> Bool Source # (/=) :: RecipientCapabilities -> RecipientCapabilities -> Bool Source # | |
recipientCapabilitiesFromSubpacketPayloads :: SomePKPayload -> [SigSubPacketPayload] -> RecipientCapabilities Source #
Extract encrypt-relevant recipient capabilities from effective self-signature subpackets.
RFC 9580 preferred AEAD ciphersuites are currently carried through
OtherSigSub type 39 and decoded into AEAD preferences here.
data RecipientTargetRejectionReason Source #
Constructors
Instances
data RecipientEncryptionTargetRejected Source #
Constructors
| RecipientEncryptionTargetRejected | |
data RecipientEncryptionTargetsReport Source #
Constructors
| RecipientEncryptionTargetsReport | |
Instances
recipientEncryptionTargetsReportFromTKAtTimestamp :: ThirtyTwoBitTimeStamp -> TKUnknown -> RecipientEncryptionTargetsReport Source #
recipientEncryptionTargetFromTKAtTimestamp :: ThirtyTwoBitTimeStamp -> TKUnknown -> Either RecipientCapabilityError RecipientEncryptionTarget Source #
recipientEncryptionTargetFromTKAtTimestampWithPolicy :: RecipientTargetSelectionPolicy -> ThirtyTwoBitTimeStamp -> TKUnknown -> Either RecipientCapabilityError RecipientEncryptionTarget Source #
recipientEncryptionTargetsFromTKAtTimestamp :: ThirtyTwoBitTimeStamp -> TKUnknown -> [RecipientEncryptionTarget] Source #
recipientEncryptionTargetFromTK :: TK 'PublicTK -> Either RecipientCapabilityError RecipientEncryptionTarget Source #
recipientEncryptionTargetFromTKWithPolicy :: RecipientTargetSelectionPolicy -> TK 'PublicTK -> Either RecipientCapabilityError RecipientEncryptionTarget Source #
data RecipientTargetSelectionPolicy Source #
Constructors
| RecipientTargetSelectionFirstValid | |
| RecipientTargetSelectionPreferPrimary | |
| RecipientTargetSelectionPreferSubkey | |
| RecipientTargetSelectionPreferNewestCreationTime |
Instances
data PassphraseSKESKVersionPolicy Source #
Constructors
| PassphraseSKESKPreferV6 | |
| PassphraseSKESKForceV4Interop |
Instances
data PassphraseEncryptRequest Source #
Constructors
Instances
| Show PassphraseEncryptRequest Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt | |
| Eq PassphraseEncryptRequest Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt Methods (==) :: PassphraseEncryptRequest -> PassphraseEncryptRequest -> Bool Source # (/=) :: PassphraseEncryptRequest -> PassphraseEncryptRequest -> Bool Source # | |
encryptPassphraseWithPolicy :: MonadRandom m => PassphraseEncryptRequest -> m (Either String [Pkt]) Source #
data PKESKVersionPolicy Source #
Constructors
| PreferV6 | |
| ForceV3Interop |
Instances
| Show PKESKVersionPolicy Source # | |
Defined in Codec.Encryption.OpenPGP.Policy | |
| Eq PKESKVersionPolicy Source # | |
Defined in Codec.Encryption.OpenPGP.Policy Methods (==) :: PKESKVersionPolicy -> PKESKVersionPolicy -> Bool Source # (/=) :: PKESKVersionPolicy -> PKESKVersionPolicy -> Bool Source # | |
data RecipientPKESKVersionStrategy Source #
Constructors
| RecipientPreferV6 | |
| RecipientForceV3Interop |
Instances
data RecipientPKESKVersionStrategyW (strategy :: RecipientPKESKVersionStrategy) where Source #
data SomeRecipientPKESKVersionStrategyW where Source #
Constructors
| SomeRecipientPKESKVersionStrategyW :: forall (strategy :: RecipientPKESKVersionStrategy). RecipientPKESKVersionStrategyW strategy -> SomeRecipientPKESKVersionStrategyW |
type RecipientPKESKVersionSelector = SomePKPayload -> Either PKESKEncryptError RecipientPKESKVersionStrategy Source #
type RecipientPKESKVersionSelectorTyped = SomePKPayload -> Either PKESKEncryptError SomeRecipientPKESKVersionStrategyW Source #
data EncryptCompatibilityProfile Source #
Constructors
| EncryptStrictDefault | |
| EncryptInteropLegacy |
Instances
data EncryptCompatibilityProfileW (profile :: EncryptCompatibilityProfile) where Source #
data SomeEncryptCompatibilityProfileW where Source #
Constructors
| SomeEncryptCompatibilityProfileW :: forall (profile :: EncryptCompatibilityProfile). EncryptCompatibilityProfileW profile -> SomeEncryptCompatibilityProfileW |
data RecipientEncryptionTarget Source #
Constructors
| RecipientEncryptionTarget | |
Fields
| |
Instances
| Show RecipientEncryptionTarget Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt | |
| Eq RecipientEncryptionTarget Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt Methods (==) :: RecipientEncryptionTarget -> RecipientEncryptionTarget -> Bool Source # (/=) :: RecipientEncryptionTarget -> RecipientEncryptionTarget -> Bool Source # | |
recipientEncryptionTargetWithStrategy :: SomePKPayload -> RecipientPKESKVersionStrategy -> RecipientEncryptionTarget Source #
recipientEncryptionTargetWithCapabilities :: SomePKPayload -> RecipientCapabilities -> RecipientEncryptionTarget Source #
recipientEncryptionTargetWithStrategyTyped :: forall (strategy :: RecipientPKESKVersionStrategy). SomePKPayload -> RecipientPKESKVersionStrategyW strategy -> RecipientEncryptionTarget Source #
recipientVersionStrategyForProfile :: EncryptCompatibilityProfile -> RecipientEncryptionTarget -> Either PKESKEncryptError RecipientPKESKVersionStrategy Source #
recipientVersionStrategyForProfileTyped :: forall (profile :: EncryptCompatibilityProfile). EncryptCompatibilityProfileW profile -> RecipientEncryptionTarget -> Either PKESKEncryptError SomeRecipientPKESKVersionStrategyW Source #
data RecipientPayloadShape Source #
Constructors
| RecipientPayloadShape | |
Instances
| Show RecipientPayloadShape Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt | |
| Eq RecipientPayloadShape Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt Methods (==) :: RecipientPayloadShape -> RecipientPayloadShape -> Bool Source # (/=) :: RecipientPayloadShape -> RecipientPayloadShape -> Bool Source # | |
data SEIPDVersion Source #
Instances
| Show SEIPDVersion Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt | |
| Eq SEIPDVersion Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt Methods (==) :: SEIPDVersion -> SEIPDVersion -> Bool Source # (/=) :: SEIPDVersion -> SEIPDVersion -> Bool Source # | |
data RecipientEncryptResult Source #
Constructors
| RecipientEncryptResult | |
Instances
| Show RecipientEncryptResult Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt | |
| Eq RecipientEncryptResult Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt Methods (==) :: RecipientEncryptResult -> RecipientEncryptResult -> Bool Source # (/=) :: RecipientEncryptResult -> RecipientEncryptResult -> Bool Source # | |
data RecipientEncryptRequest (v :: SEIPDVersion) Source #
Constructors
| RecipientEncryptRequest | |
Fields
| |
Instances
| Show (RecipientEncryptRequest v) Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt | |
| Eq (RecipientEncryptRequest v) Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt Methods (==) :: RecipientEncryptRequest v -> RecipientEncryptRequest v -> Bool Source # (/=) :: RecipientEncryptRequest v -> RecipientEncryptRequest v -> Bool Source # | |
data RecipientEncryptRequestOverrides (v :: SEIPDVersion) where Source #
Constructors
| RecipientEncryptRequestSEIPDv1Overrides | |
Fields | |
| RecipientEncryptRequestSEIPDv2Overrides | For SEIPDv2 requests:
- when AEAD override is |
Instances
| Show (RecipientEncryptRequestOverrides v) Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt | |
| Eq (RecipientEncryptRequestOverrides v) Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt Methods (==) :: RecipientEncryptRequestOverrides v -> RecipientEncryptRequestOverrides v -> Bool Source # (/=) :: RecipientEncryptRequestOverrides v -> RecipientEncryptRequestOverrides v -> Bool Source # | |
encryptForRecipients :: forall m (v :: SEIPDVersion). MonadRandom m => RecipientEncryptRequest v -> m (Either PKESKEncryptError RecipientEncryptResult) Source #
Encrypt for recipient targets with capability negotiation enabled.
By default this negotiates a common symmetric and (for SEIPDv2) AEAD algorithm from recipient capabilities when available. Explicit request overrides still take precedence.
encryptForRecipientsLegacy :: forall m (v :: SEIPDVersion). MonadRandom m => RecipientEncryptRequest v -> m (Either PKESKEncryptError RecipientEncryptResult) Source #
Encrypt for recipient targets without recipient capability negotiation.
This preserves legacy behavior by using policy defaults unless request overrides are provided.
encryptForRecipientsWithCapabilityNegotiation :: forall m (v :: SEIPDVersion). MonadRandom m => RecipientCapabilityNegotiationMode -> RecipientEncryptRequest v -> m (Either PKESKEncryptError RecipientEncryptResult) Source #
Encrypt for recipient targets with an explicit capability-negotiation mode.
When negotiation is on, symmetric and AEAD selection use the common intersection of recipient preferences constrained by the active policy. When off, policy defaults are used.
data PKESKV3SessionMaterial Source #
Session-key bundle for PKESK/SKESK packet construction.
Instances
| Show PKESKV3SessionMaterial Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt | |
| Eq PKESKV3SessionMaterial Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt Methods (==) :: PKESKV3SessionMaterial -> PKESKV3SessionMaterial -> Bool Source # (/=) :: PKESKV3SessionMaterial -> PKESKV3SessionMaterial -> Bool Source # | |
data PKESKV6RawSessionMaterial Source #
Instances
| Show PKESKV6RawSessionMaterial Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt | |
| Eq PKESKV6RawSessionMaterial Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt Methods (==) :: PKESKV6RawSessionMaterial -> PKESKV6RawSessionMaterial -> Bool Source # (/=) :: PKESKV6RawSessionMaterial -> PKESKV6RawSessionMaterial -> Bool Source # | |
data PKESKSessionMaterial Source #
Instances
| Show PKESKSessionMaterial Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt | |
| Eq PKESKSessionMaterial Source # | |
Defined in Codec.Encryption.OpenPGP.Encrypt Methods (==) :: PKESKSessionMaterial -> PKESKSessionMaterial -> Bool Source # (/=) :: PKESKSessionMaterial -> PKESKSessionMaterial -> Bool Source # | |
mkPKESKSessionMaterial :: SymmetricAlgorithm -> SessionKey -> Either PKESKEncryptError PKESKSessionMaterial Source #
mkPKESKV3SessionMaterial :: SymmetricAlgorithm -> SessionKey -> Either PKESKEncryptError PKESKV3SessionMaterial Source #
mkPKESKV6RawSessionMaterial :: SymmetricAlgorithm -> SessionKey -> Either PKESKEncryptError PKESKV6RawSessionMaterial Source #
encodeOpenPGPSessionMaterial :: SymmetricAlgorithm -> SessionKey -> Either PKESKEncryptError ByteString Source #
Encode the RFC 9580 PKESK/SKESK session-key material: one-octet algorithm ID, raw session key, then 16-bit checksum.
generateSessionKeyMaterial :: MonadRandom m => SymmetricAlgorithm -> m (Either PKESKEncryptError PKESKSessionMaterial) Source #
Generate a fresh session key and return both raw and encoded forms.
buildPKESKv3PayloadForRecipient :: MonadRandom m => SomePKPayload -> PKESKV3SessionMaterial -> m (Either PKESKEncryptError PKESKPayload) Source #
Build a legacy PKESKv3 payload for v4/v3 RSA recipient interop.
buildPKESKv3PktForRecipient :: MonadRandom m => SomePKPayload -> PKESKV3SessionMaterial -> m (Either PKESKEncryptError Pkt) Source #
Build a legacy PKESKv3 packet for v4/v3 RSA recipient interop.
buildPKESKPayloadForRecipient :: MonadRandom m => PKESKVersionPolicy -> SomePKPayload -> PKESKSessionMaterial -> m (Either PKESKEncryptError PKESKPayload) Source #
Build a v6 PKESK payload for one recipient key according to the selected version policy.
buildPKESKPktForRecipient :: MonadRandom m => PKESKVersionPolicy -> SomePKPayload -> PKESKSessionMaterial -> m (Either PKESKEncryptError Pkt) Source #
Build a PKESK packet for one recipient key according to the selected version policy.
buildPKESKPktsForRecipientTargetsWithSelector :: MonadRandom m => (RecipientEncryptionTarget -> Either PKESKEncryptError RecipientPKESKVersionStrategy) -> [RecipientEncryptionTarget] -> PKESKSessionMaterial -> m (Either PKESKEncryptError [Pkt]) Source #
Build PKESK packets for all recipients with a single shared session key.
buildPKESKPktsForRecipientTargetsWithSelectorTyped :: MonadRandom m => (RecipientEncryptionTarget -> Either PKESKEncryptError SomeRecipientPKESKVersionStrategyW) -> [RecipientEncryptionTarget] -> PKESKSessionMaterial -> m (Either PKESKEncryptError [Pkt]) Source #
encryptSEIPDv2Payload :: SymmetricAlgorithm -> AEADAlgorithm -> Word8 -> Salt -> SessionKey -> ByteString -> Either String ByteString Source #
encryptSEIPDv1Payload Source #
Arguments
| :: SymmetricAlgorithm | |
| -> IV | |
| -> SessionKey | |
| -> ByteString | inner packet block plaintext |
| -> Either String ByteString |
Encrypt a plaintext block with OpenPGP CFB + MDC to produce a SEIPDv1 ciphertext.
encryptSEIPDv2WithSKESK :: SymmetricAlgorithm -> AEADAlgorithm -> Word8 -> Salt -> S2K -> ByteString -> ByteString -> Either String [Pkt] Source #
encryptSEIPDv2WithSKESKBlock :: SymmetricAlgorithm -> AEADAlgorithm -> Word8 -> Salt -> S2K -> ByteString -> Block Pkt -> Either String [Pkt] Source #
encryptSEIPDv2LiteralDataWithSKESK :: SymmetricAlgorithm -> AEADAlgorithm -> Word8 -> Salt -> S2K -> ByteString -> ByteString -> Either String [Pkt] Source #
composeMessageWithSEIPDv2 :: SymmetricAlgorithm -> AEADAlgorithm -> Word8 -> Salt -> S2K -> ByteString -> ByteString -> Maybe [Pkt] -> Either String [Pkt] Source #
Compose a complete AEAD-encrypted message with optional literal data and signature. Returns a packet list (SKESK, SEIPD v2, optional signature) ready for serialization.
Example: composeMessageWithSEIPDv2 AES256 OCB 6 (Salt 32 bytes)
(SimpleS2K SHA256) passphrase payload Nothing
returns [SKESK v6, SEIPD v2, ciphertext]
If the signature is provided, it will be included in the encrypted payload.