diff options
author | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2020-12-11 10:16:40 +0100 |
---|---|---|
committer | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2020-12-11 16:36:45 +0100 |
commit | 90105c50559da50d7e601dca6a27040e03e430a1 (patch) | |
tree | 3800d6c3991cc69634975243db1436d87fb4b418 /openpgp | |
parent | 8f71996c37ed1d87778aa3ca885719f4c2a72c70 (diff) |
openpgp: Suggest StandardPolicy in NullPolicy docs.
- Fixes #473.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/policy.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/openpgp/src/policy.rs b/openpgp/src/policy.rs index e980b99e..6aa027cd 100644 --- a/openpgp/src/policy.rs +++ b/openpgp/src/policy.rs @@ -1344,6 +1344,17 @@ impl From<AsymmetricAlgorithm> for u8 { /// This policy imposes no additional policy, i.e., accepts /// everything. This includes the MD5 hash algorithm, and SED /// packets. +/// +/// The Null policy has a limited set of valid use cases, e.g., packet statistics. +/// For other purposes, it is more advisable to use the [`StandardPolicy`] and +/// adjust it by selectively allowing items considered insecure by default, e.g., +/// via [`StandardPolicy::accept_hash`] function. If this is still too inflexible +/// consider creating a specialized policy based on the [`StandardPolicy`] as +/// [the example for `StandardPolicy`] illustrates. +/// +/// [`StandardPolicy`]: struct.StandardPolicy.html +/// [`StandardPolicy::accept_hash`]: struct.StandardPolicy.html#method.accept_hash +/// [the example for `StandardPolicy`]: struct.StandardPolicy.html#examples #[derive(Debug)] pub struct NullPolicy { } |