summaryrefslogtreecommitdiffstats
path: root/openpgp/src/lib.rs
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-02-09 17:32:17 +0100
committerNeal H. Walfield <neal@pep.foundation>2020-02-09 17:32:17 +0100
commit7c443124abce89ba64c77a9a218228a4f5cc2856 (patch)
treed02fa54727ea4dfe16c9e57b2334768d5da36941 /openpgp/src/lib.rs
parent1855e7bde6becc05b70bd661abf5a56512e33c37 (diff)
openpgp: Add new error, PolicyViolation.
Diffstat (limited to 'openpgp/src/lib.rs')
-rw-r--r--openpgp/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/openpgp/src/lib.rs b/openpgp/src/lib.rs
index 6802861b..b2cf4e48 100644
--- a/openpgp/src/lib.rs
+++ b/openpgp/src/lib.rs
@@ -299,6 +299,13 @@ pub enum Error {
#[fail(display = "Invalid key: {:?}", _0)]
InvalidKey(String),
+ /// The operation is not allowed, because it violates the policy.
+ ///
+ /// The optional time is the time at which the operation was
+ /// determined to no longer be secure.
+ #[fail(display = "Not secure as of: {:?}: {}", _1, _0)]
+ PolicyViolation(String, Option<std::time::SystemTime>),
+
/// This marks this enum as non-exhaustive. Do not use this
/// variant.
#[doc(hidden)] #[fail(display = "__Nonexhaustive")] __Nonexhaustive,