Struct pgp::composed::signed_key::public::SignedPublicKey
source · [−]pub struct SignedPublicKey {
pub primary_key: PublicKey,
pub details: SignedKeyDetails,
pub public_subkeys: Vec<SignedPublicSubKey>,
}
Expand description
Represents a Public PGP key, which is signed and either received or ready to be transferred.
Fields
primary_key: PublicKey
details: SignedKeyDetails
public_subkeys: Vec<SignedPublicSubKey>
Implementations
sourceimpl SignedPublicKey
impl SignedPublicKey
pub fn new(
primary_key: PublicKey,
details: SignedKeyDetails,
public_subkeys: Vec<SignedPublicSubKey>
) -> Self
sourcepub fn expires_at(&self) -> Option<DateTime<Utc>>
pub fn expires_at(&self) -> Option<DateTime<Utc>>
Get the public key expiration as a date.
pub fn verify(&self) -> Result<()>
pub fn to_armored_writer(
&self,
writer: &mut impl Write,
headers: Option<&BTreeMap<String, String>>
) -> Result<()>
pub fn to_armored_bytes(
&self,
headers: Option<&BTreeMap<String, String>>
) -> Result<Vec<u8>>
pub fn to_armored_string(
&self,
headers: Option<&BTreeMap<String, String>>
) -> Result<String>
pub fn as_unsigned(&self) -> PublicKey
Trait Implementations
sourceimpl Clone for SignedPublicKey
impl Clone for SignedPublicKey
sourcefn clone(&self) -> SignedPublicKey
fn clone(&self) -> SignedPublicKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SignedPublicKey
impl Debug for SignedPublicKey
sourceimpl Deserializable for SignedPublicKey
impl Deserializable for SignedPublicKey
sourcefn from_packets<'a>(
packets: impl Iterator<Item = Packet> + 'a
) -> Box<dyn Iterator<Item = Result<Self>> + 'a>
fn from_packets<'a>(
packets: impl Iterator<Item = Packet> + 'a
) -> Box<dyn Iterator<Item = Result<Self>> + 'a>
Parse a transferable key from packets. Ref: https://tools.ietf.org/html/rfc4880.html#section-11.1
sourcefn from_bytes(bytes: impl Read) -> Result<Self>
fn from_bytes(bytes: impl Read) -> Result<Self>
Parse a single byte encoded composition.
sourcefn from_string(input: &str) -> Result<(Self, BTreeMap<String, String>)>
fn from_string(input: &str) -> Result<(Self, BTreeMap<String, String>)>
Parse a single armor encoded composition.
sourcefn from_string_many<'a>(
input: &'a str
) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, BTreeMap<String, String>)>
fn from_string_many<'a>(
input: &'a str
) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, BTreeMap<String, String>)>
Parse an armor encoded list of compositions.
sourcefn from_armor_single<R: Read + Seek>(
input: R
) -> Result<(Self, BTreeMap<String, String>)>
fn from_armor_single<R: Read + Seek>(
input: R
) -> Result<(Self, BTreeMap<String, String>)>
Armored ascii data.
sourceimpl KeyTrait for SignedPublicKey
impl KeyTrait for SignedPublicKey
fn fingerprint(&self) -> Vec<u8>
fn algorithm(&self) -> PublicKeyAlgorithm
fn is_signing_key(&self) -> bool
fn is_encryption_key(&self) -> bool
sourceimpl PartialEq<SignedPublicKey> for SignedPublicKey
impl PartialEq<SignedPublicKey> for SignedPublicKey
sourcefn eq(&self, other: &SignedPublicKey) -> bool
fn eq(&self, other: &SignedPublicKey) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SignedPublicKey) -> bool
fn ne(&self, other: &SignedPublicKey) -> bool
This method tests for !=
.
sourceimpl PublicKeyTrait for SignedPublicKey
impl PublicKeyTrait for SignedPublicKey
sourcefn verify_signature(
&self,
hash: HashAlgorithm,
data: &[u8],
sig: &[Mpi]
) -> Result<()>
fn verify_signature(
&self,
hash: HashAlgorithm,
data: &[u8],
sig: &[Mpi]
) -> Result<()>
Verify a signed message.
Data will be hashed using hash
, before verifying. Read more
sourcefn encrypt<R: Rng + CryptoRng>(
&self,
rng: &mut R,
plain: &[u8]
) -> Result<Vec<Mpi>>
fn encrypt<R: Rng + CryptoRng>(
&self,
rng: &mut R,
plain: &[u8]
) -> Result<Vec<Mpi>>
Encrypt the given plain
for this key.
sourcefn to_writer_old(&self, writer: &mut impl Write) -> Result<()>
fn to_writer_old(&self, writer: &mut impl Write) -> Result<()>
This is the data used for hashing in a signature. Only uses the public portion of the key.
sourceimpl Serialize for SignedPublicKey
impl Serialize for SignedPublicKey
impl Eq for SignedPublicKey
impl StructuralEq for SignedPublicKey
impl StructuralPartialEq for SignedPublicKey
Auto Trait Implementations
impl RefUnwindSafe for SignedPublicKey
impl Send for SignedPublicKey
impl Sync for SignedPublicKey
impl Unpin for SignedPublicKey
impl UnwindSafe for SignedPublicKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more