//! Types for signatures.
use std::fmt;
use std::ops::Deref;
use constants::Curve;
use Error;
use Result;
use crypto::{
mpis,
Hash,
Signer,
};
use HashAlgorithm;
use PublicKeyAlgorithm;
use SignatureType;
use packet::Key;
use KeyID;
use packet::UserID;
use packet::UserAttribute;
use Packet;
use packet;
use packet::signature::subpacket::SubpacketArea;
use serialize::SerializeInto;
use nettle::{self, dsa, ecc, ecdsa, ed25519, rsa};
use nettle::rsa::verify_digest_pkcs1;
#[cfg(test)]
use std::path::PathBuf;
pub mod subpacket;
const TRACE : bool = false;
#[cfg(test)]
#[allow(dead_code)]
fn path_to(artifact: &str) -> PathBuf {
[env!("CARGO_MANIFEST_DIR"), "tests", "data", artifact]
.iter().collect()
}
/// Builds a signature packet.
///
/// This is the mutable version of a `Signature` packet. To convert
/// it to one, use `sign_hash(..)`.
#[derive(Clone, Hash, PartialEq, Eq)]
pub struct Builder {
/// Version of the signature packet. Must be 4.
version: u8,
/// Type of signature.
sigtype: SignatureType,
/// Pub(Crate)lic-key algorithm used for this signature.
pk_algo: PublicKeyAlgorithm,
/// Hash algorithm used to compute the signature.
hash_algo: HashAlgorithm,
/// Subpackets that are part