diff options
Diffstat (limited to 'openpgp/src/serialize/cert_armored.rs')
-rw-r--r-- | openpgp/src/serialize/cert_armored.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/openpgp/src/serialize/cert_armored.rs b/openpgp/src/serialize/cert_armored.rs index 40c05464..fd312725 100644 --- a/openpgp/src/serialize/cert_armored.rs +++ b/openpgp/src/serialize/cert_armored.rs @@ -9,6 +9,7 @@ use crate::serialize::{ Serialize, SerializeInto, generic_serialize_into, generic_export_into, }; use crate::Cert; +use crate::policy::StandardPolicy as P; /// Whether or not a character is printable. @@ -23,23 +24,25 @@ impl Cert { /// Creates descriptive armor headers. /// /// Returns armor headers that describe this Cert. The Cert's - /// primary fingerprint and userids are included as comments, so - /// that it is easier to identify the Cert when looking at the - /// armored data. + /// primary fingerprint and valid userids (according to the + /// default policy) are included as comments, so that it is easier + /// to identify the Cert when looking at the armored data. pub fn armor_headers(&self) -> Vec<String> { + let p = P::default(); + let length_value = armor::LINE_LENGTH - "Comment: ".len(); // Create a header per userid. let mut headers: Vec<String> = self.userids().bindings() // Ignore revoked userids. .filter_map(|uidb| { - if let RevocationStatus::Revoked(_) = uidb.revoked(None) { + if let RevocationStatus::Revoked(_) = uidb.revoked(&p, None) { None } else { Some(uidb) } // Ignore userids not "alive". }).filter_map(|uidb| { - if uidb.binding_signature(None)? + if uidb.binding_signature(&p, None)? .signature_alive(None, None).is_ok() { Some(uidb) |