Struct pgp::composed::signed_key::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§
source§impl 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§
source§impl Clone for SignedPublicKey
impl Clone for SignedPublicKey
source§fn clone(&self) -> SignedPublicKey
fn clone(&self) -> SignedPublicKey
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SignedPublicKey
impl Debug for SignedPublicKey
source§impl Deserializable for SignedPublicKey
impl Deserializable for SignedPublicKey
source§fn from_packets<'a, I: Iterator<Item = Result<Packet>> + 'a>(
packets: Peekable<I>
) -> Box<dyn Iterator<Item = Result<Self>> + 'a>
fn from_packets<'a, I: Iterator<Item = Result<Packet>> + 'a>( packets: Peekable<I> ) -> Box<dyn Iterator<Item = Result<Self>> + 'a>
Parse a transferable key from packets. Ref: https://tools.ietf.org/html/rfc4880.html#section-11.1
source§fn from_bytes(bytes: impl Read) -> Result<Self>
fn from_bytes(bytes: impl Read) -> Result<Self>
Parse a single byte encoded composition.
source§fn 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.
source§fn 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.
source§fn 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.
source§fn from_armor_many<'a, R: Read + Seek + 'a>(
input: R
) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, BTreeMap<String, String>)>
fn from_armor_many<'a, R: Read + Seek + 'a>( input: R ) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, BTreeMap<String, String>)>
Armored ascii data.
source§fn from_bytes_many<'a>(
bytes: impl Read + 'a
) -> Box<dyn Iterator<Item = Result<Self>> + 'a>
fn from_bytes_many<'a>( bytes: impl Read + 'a ) -> Box<dyn Iterator<Item = Result<Self>> + 'a>
Parse a list of compositions in raw byte format.
source§impl From<SignedSecretKey> for SignedPublicKey
impl From<SignedSecretKey> for SignedPublicKey
source§fn from(value: SignedSecretKey) -> Self
fn from(value: SignedSecretKey) -> Self
Converts to this type from the input type.
source§impl KeyTrait for SignedPublicKey
impl KeyTrait for SignedPublicKey
source§impl PartialEq for SignedPublicKey
impl PartialEq for SignedPublicKey
source§fn 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 ==
.source§impl PublicKeyTrait for SignedPublicKey
impl PublicKeyTrait for SignedPublicKey
source§fn 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.source§impl Serialize for SignedPublicKey
impl Serialize for SignedPublicKey
impl Eq for SignedPublicKey
impl StructuralPartialEq for SignedPublicKey
Auto Trait Implementations§
impl Freeze for SignedPublicKey
impl RefUnwindSafe for SignedPublicKey
impl Send for SignedPublicKey
impl Sync for SignedPublicKey
impl Unpin for SignedPublicKey
impl UnwindSafe for SignedPublicKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more