diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-08-05 11:53:22 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-08-05 13:05:09 +0200 |
commit | 7d4090c4c862e6f38f5a17a9ad77484bf219909d (patch) | |
tree | f70a89f90b06616557b151bea15b63d7e2e81a7d /openpgp/src/cert/amalgamation/key | |
parent | 78e9b6626ba96fa918f53e524720d595a6bb9340 (diff) |
openpgp: Don't implement Default for the Bitflags types.
- See #525.
Diffstat (limited to 'openpgp/src/cert/amalgamation/key')
-rw-r--r-- | openpgp/src/cert/amalgamation/key/iter.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/openpgp/src/cert/amalgamation/key/iter.rs b/openpgp/src/cert/amalgamation/key/iter.rs index f1d66c0c..d14fdc0b 100644 --- a/openpgp/src/cert/amalgamation/key/iter.rs +++ b/openpgp/src/cert/amalgamation/key/iter.rs @@ -947,7 +947,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// [Section 12.1 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5.2.3.21 /// [`ValidKeyAmalgamation::key_flags`]: struct.ValidKeyAmalgamation.html#method.key_flags pub fn for_certification(self) -> Self { - self.key_flags(KeyFlags::default().set_certification()) + self.key_flags(KeyFlags::empty().set_certification()) } /// Returns signing-capable keys. @@ -990,7 +990,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// /// [`ValidKeyAmalgamation::for_signing`]: struct.ValidKeyAmalgamation.html#method.for_signing pub fn for_signing(self) -> Self { - self.key_flags(KeyFlags::default().set_signing()) + self.key_flags(KeyFlags::empty().set_signing()) } /// Returns authentication-capable keys. @@ -1033,7 +1033,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// /// [`ValidKeyAmalgamation::for_authentication`]: struct.ValidKeyAmalgamation.html#method.for_authentication pub fn for_authentication(self) -> Self { - self.key_flags(KeyFlags::default().set_authentication()) + self.key_flags(KeyFlags::empty().set_authentication()) } /// Returns encryption-capable keys for data at rest. @@ -1076,7 +1076,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// /// [`ValidKeyAmalgamation::for_storage_encryption`]: struct.ValidKeyAmalgamation.html#method.for_storage_encryption pub fn for_storage_encryption(self) -> Self { - self.key_flags(KeyFlags::default().set_storage_encryption()) + self.key_flags(KeyFlags::empty().set_storage_encryption()) } /// Returns encryption-capable keys for data in transit. @@ -1119,7 +1119,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// /// [`ValidKeyAmalgamation::for_transport_encryption`]: struct.ValidKeyAmalgamation.html#method.for_transport_encryption pub fn for_transport_encryption(self) -> Self { - self.key_flags(KeyFlags::default().set_transport_encryption()) + self.key_flags(KeyFlags::empty().set_transport_encryption()) } /// Returns keys that are alive. @@ -1533,7 +1533,7 @@ mod test { let p = &P::new(); let (cert, _) = CertBuilder::new() .generate().unwrap(); - let flags = KeyFlags::default().set_transport_encryption(); + let flags = KeyFlags::empty().set_transport_encryption(); assert_eq!(cert.keys().with_policy(p, None).key_flags(flags).count(), 0); } @@ -1544,7 +1544,7 @@ mod test { let (cert, _) = CertBuilder::new() .add_transport_encryption_subkey() .generate().unwrap(); - let flags = KeyFlags::default().set_transport_encryption(); + let flags = KeyFlags::empty().set_transport_encryption(); assert_eq!(cert.keys().with_policy(p, None).key_flags(flags).count(), 1); } @@ -1556,7 +1556,7 @@ mod test { .add_transport_encryption_subkey() .add_signing_subkey() .generate().unwrap(); - let flags = KeyFlags::default().set_transport_encryption(); + let flags = KeyFlags::empty().set_transport_encryption(); assert_eq!(cert.keys().with_policy(p, None).key_flags(flags).count(), 1); } @@ -1567,7 +1567,7 @@ mod test { let (cert, _) = CertBuilder::new() .add_transport_encryption_subkey() .generate().unwrap(); - let flags = KeyFlags::default().set_transport_encryption(); + let flags = KeyFlags::empty().set_transport_encryption(); let now = SystemTime::now() - std::time::Duration::new(52 * 7 * 24 * 60 * 60, 0); @@ -1581,7 +1581,7 @@ mod test { let (cert, _) = CertBuilder::new() .add_certification_subkey() .generate().unwrap(); - let flags = KeyFlags::default().set_certification(); + let flags = KeyFlags::empty().set_certification(); assert_eq!(cert.keys().with_policy(p, None).key_flags(flags).count(), 2); @@ -1611,7 +1611,7 @@ mod test { .for_signing().count(), 1); assert_eq!(cert.keys().with_policy(p, None).alive().revoked(false) - .key_flags(KeyFlags::default().set_authentication()) + .key_flags(KeyFlags::empty().set_authentication()) .count(), 1); } |