diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-02-06 16:13:06 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-02-06 16:13:20 +0100 |
commit | bb19d1ad4b58b6392e0c9588809f690c9e403783 (patch) | |
tree | 855704f84fa26e4cfa322dc75d101070d28829df | |
parent | 35dfd910e87262f9159b62837821ee47773cf054 (diff) |
openpgp: New public constructor Signature::new.
- Fixes #173.
-rw-r--r-- | openpgp/src/packet/signature/mod.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/openpgp/src/packet/signature/mod.rs b/openpgp/src/packet/signature/mod.rs index bdec0084..cbee74e7 100644 --- a/openpgp/src/packet/signature/mod.rs +++ b/openpgp/src/packet/signature/mod.rs @@ -350,11 +350,17 @@ impl PartialEq for Signature { } impl Signature { - pub(crate) fn new(sigtype: SignatureType, pk_algo: PublicKeyAlgorithm, - hash_algo: HashAlgorithm, hashed_area: SubpacketArea, - unhashed_area: SubpacketArea, - hash_prefix: [u8; 2], - mpis: mpis::Signature) -> Self { + /// Creates a new signature packet. + /// + /// If you want to sign something, consider using the [`Builder`] + /// interface. + /// + /// [`Builder`]: struct.Builder.html + pub fn new(sigtype: SignatureType, pk_algo: PublicKeyAlgorithm, + hash_algo: HashAlgorithm, hashed_area: SubpacketArea, + unhashed_area: SubpacketArea, + hash_prefix: [u8; 2], + mpis: mpis::Signature) -> Self { Signature { common: Default::default(), fields: Builder { |