| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Codec.Encryption.OpenPGP.Policy
Synopsis
- data OpenPGPRFC
- data OpenPGPRFCW (rfc :: OpenPGPRFC) where
- data SomeOpenPGPRFCW where
- SomeOpenPGPRFCW :: forall (rfc :: OpenPGPRFC). OpenPGPRFCW rfc -> SomeOpenPGPRFCW
- promoteOpenPGPRFC :: OpenPGPRFC -> SomeOpenPGPRFCW
- demoteOpenPGPRFCW :: forall (rfc :: OpenPGPRFC). OpenPGPRFCW rfc -> OpenPGPRFC
- data HashAlgorithmW (h :: HashAlgorithm) where
- DeprecatedMD5W :: HashAlgorithmW 'DeprecatedMD5
- SHA1W :: HashAlgorithmW 'SHA1
- RIPEMD160W :: HashAlgorithmW 'RIPEMD160
- SHA256W :: HashAlgorithmW 'SHA256
- SHA384W :: HashAlgorithmW 'SHA384
- SHA512W :: HashAlgorithmW 'SHA512
- SHA224W :: HashAlgorithmW 'SHA224
- SHA3_256W :: HashAlgorithmW 'SHA3_256
- SHA3_512W :: HashAlgorithmW 'SHA3_512
- data SomeHashAlgorithmW where
- SomeHashAlgorithmW :: forall (h :: HashAlgorithm). HashAlgorithmW h -> SomeHashAlgorithmW
- promoteHashAlgorithm :: HashAlgorithm -> Maybe SomeHashAlgorithmW
- demoteHashAlgorithmW :: forall (h :: HashAlgorithm). HashAlgorithmW h -> HashAlgorithm
- data HashAlgoStatus
- type family HashAlgoStatusFor (rfc :: OpenPGPRFC) (h :: HashAlgorithm) :: HashAlgoStatus where ...
- type HashAlgoAllowedFor (rfc :: OpenPGPRFC) (h :: HashAlgorithm) = AssertHashAllowed (HashAlgoStatusFor rfc h)
- type HashAlgoVerifiableFor (rfc :: OpenPGPRFC) (h :: HashAlgorithm) = AssertHashVerifiable (HashAlgoStatusFor rfc h)
- data PKESKVersionPolicy
- data MessageEncryptionPolicy = MessageEncryptionPolicy {}
- data SecretKeyProtectionPolicy = SecretKeyProtectionPolicy {}
- data GenerationDeprecationPolicy = GenerationDeprecationPolicy {}
- data VerificationDefaults = VerificationDefaults {}
- data DecryptPolicy = DecryptPolicy {}
- data OpenPGPPolicy = OpenPGPPolicy {}
- policyForRFC :: OpenPGPRFC -> OpenPGPPolicy
- defaultPolicy :: OpenPGPPolicy
- defaultPKESKVersionPolicy :: PKESKVersionPolicy
- defaultVerificationDefaults :: VerificationDefaults
- defaultDecryptPolicy :: DecryptPolicy
- lenientDecryptPolicy :: DecryptPolicy
- supportsSEIPDv2Symmetric :: OpenPGPPolicy -> SymmetricAlgorithm -> Bool
- secretKeyProtectionPolicyForKeyVersion :: OpenPGPPolicy -> KeyVersion -> Maybe SecretKeyProtectionPolicy
- signatureV6SaltSizeForHashAlgorithm :: HashAlgorithm -> Maybe Word8
- ecdhKdfHashDigest :: HashAlgorithm -> ByteString -> Either String ByteString
- validateTable30PolicyForRecipient :: SomePKPayload -> HashAlgorithm -> SymmetricAlgorithm -> Either String ()
- legacySecretKeyProtectionErrorMessage :: String
- isAllowedPrimaryKeySig :: SignaturePayload -> Bool
- isAllowedSubkeySig :: SignaturePayload -> Bool
- isAllowedUIDSig :: SignaturePayload -> Bool
- isAllowedPrimaryKeySigType :: SigType -> Bool
- isAllowedSubkeySigType :: SigType -> Bool
- isAllowedUIDSigType :: SigType -> Bool
Documentation
data OpenPGPRFC Source #
Instances
| Show OpenPGPRFC Source # | |
Defined in Codec.Encryption.OpenPGP.Policy | |
| Eq OpenPGPRFC Source # | |
Defined in Codec.Encryption.OpenPGP.Policy Methods (==) :: OpenPGPRFC -> OpenPGPRFC -> Bool Source # (/=) :: OpenPGPRFC -> OpenPGPRFC -> Bool Source # | |
data OpenPGPRFCW (rfc :: OpenPGPRFC) where Source #
Constructors
| RFC2440W :: OpenPGPRFCW 'RFC2440 | |
| RFC4880W :: OpenPGPRFCW 'RFC4880 | |
| RFC9580W :: OpenPGPRFCW 'RFC9580 |
data SomeOpenPGPRFCW where Source #
Constructors
| SomeOpenPGPRFCW :: forall (rfc :: OpenPGPRFC). OpenPGPRFCW rfc -> SomeOpenPGPRFCW |
demoteOpenPGPRFCW :: forall (rfc :: OpenPGPRFC). OpenPGPRFCW rfc -> OpenPGPRFC Source #
data HashAlgorithmW (h :: HashAlgorithm) where Source #
Constructors
data SomeHashAlgorithmW where Source #
Constructors
| SomeHashAlgorithmW :: forall (h :: HashAlgorithm). HashAlgorithmW h -> SomeHashAlgorithmW |
demoteHashAlgorithmW :: forall (h :: HashAlgorithm). HashAlgorithmW h -> HashAlgorithm Source #
data HashAlgoStatus Source #
Constructors
| HashAllowed | |
| HashShouldNot | |
| HashMustNot |
type family HashAlgoStatusFor (rfc :: OpenPGPRFC) (h :: HashAlgorithm) :: HashAlgoStatus where ... Source #
Equations
type HashAlgoAllowedFor (rfc :: OpenPGPRFC) (h :: HashAlgorithm) = AssertHashAllowed (HashAlgoStatusFor rfc h) Source #
type HashAlgoVerifiableFor (rfc :: OpenPGPRFC) (h :: HashAlgorithm) = AssertHashVerifiable (HashAlgoStatusFor rfc h) 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 MessageEncryptionPolicy Source #
Constructors
| MessageEncryptionPolicy | |
data GenerationDeprecationPolicy Source #
Constructors
| GenerationDeprecationPolicy | |
data VerificationDefaults Source #
Constructors
| VerificationDefaults | |
data DecryptPolicy Source #
Per-message decrypt-side enforcement policy.
defaultDecryptPolicy applies RFC9580-strict rules: no unauthenticated
(SED) ciphertext, modern symmetric algorithms only, and rejection of
deprecated S2K specifiers in SKESK. Use lenientDecryptPolicy when
interoperating with older RFC4880 or RFC2440 messages.
Constructors
| DecryptPolicy | |
Fields
| |
Instances
| Show DecryptPolicy Source # | |
Defined in Codec.Encryption.OpenPGP.Policy | |
| Eq DecryptPolicy Source # | |
Defined in Codec.Encryption.OpenPGP.Policy Methods (==) :: DecryptPolicy -> DecryptPolicy -> Bool Source # (/=) :: DecryptPolicy -> DecryptPolicy -> Bool Source # | |
data OpenPGPPolicy Source #
defaultDecryptPolicy :: DecryptPolicy Source #
RFC9580-strict decrypt policy. Rejects unauthenticated SED ciphertext, restricts session-key symmetric algorithms to AES-128192256 and AEAD to EAXOCBGCM, and rejects SKESK packets carrying deprecated Simple or Salted S2K specifiers. SEIPDv1 (MDC-protected) is still accepted for interoperability with RFC4880 senders.
lenientDecryptPolicy :: DecryptPolicy Source #
Permissive decrypt policy for interoperability with RFC4880 and RFC2440 messages. No algorithm or integrity restrictions are applied.
secretKeyProtectionPolicyForKeyVersion :: OpenPGPPolicy -> KeyVersion -> Maybe SecretKeyProtectionPolicy Source #
validateTable30PolicyForRecipient :: SomePKPayload -> HashAlgorithm -> SymmetricAlgorithm -> Either String () Source #
Signature context validation (RFC9580/RFC4880)
isAllowedPrimaryKeySig :: SignaturePayload -> Bool Source #
RFC9580 §3.2: Primary key can only have KeyRevocationSig or SignatureDirectlyOnAKey
isAllowedSubkeySig :: SignaturePayload -> Bool Source #
RFC9580 §3.3: Subkey can only have SubkeyBindingSig or SubkeyRevocationSig
isAllowedUIDSig :: SignaturePayload -> Bool Source #
RFC9580 §3.4: User ID can only have various certification types or CertRevocationSig
Signature type validation helpers (for parser use)
isAllowedPrimaryKeySigType :: SigType -> Bool Source #
Test if a SigType is allowed on a primary key
isAllowedSubkeySigType :: SigType -> Bool Source #
Test if a SigType is allowed on a subkey
isAllowedUIDSigType :: SigType -> Bool Source #
Test if a SigType is allowed on a User ID