summaryrefslogtreecommitdiffstats
path: root/openpgp/src/cert/bundle.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/cert/bundle.rs')
-rw-r--r--openpgp/src/cert/bundle.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/openpgp/src/cert/bundle.rs b/openpgp/src/cert/bundle.rs
index 077dfdc0..c5d7ab5b 100644
--- a/openpgp/src/cert/bundle.rs
+++ b/openpgp/src/cert/bundle.rs
@@ -179,6 +179,27 @@ impl<C> Deref for ComponentBundle<C>
}
impl<C> ComponentBundle<C> {
+ /// Creates a new component.
+ ///
+ /// Should only be used from the cert parser. However, we cannot
+ /// use `pub(in ...)` because the cert parser isn't an ancestor of
+ /// this module.
+ pub(crate) fn new(component: C,
+ hash_algo_security: HashAlgoSecurity,
+ sigs: Vec<Signature>)
+ -> ComponentBundle<C>
+ {
+ ComponentBundle {
+ component,
+ hash_algo_security,
+ self_signatures: vec![],
+ certifications: sigs,
+ attestations: vec![],
+ self_revocations: vec![],
+ other_revocations: vec![],
+ }
+ }
+
/// Returns a reference to the bundle's component.
///
/// # Examples