Enum sequoia_openpgp::crypto::mpi::SecretKeyMaterial [−][src]
#[non_exhaustive] pub enum SecretKeyMaterial { RSA { d: ProtectedMPI, p: ProtectedMPI, q: ProtectedMPI, u: ProtectedMPI, }, DSA { x: ProtectedMPI, }, ElGamal { x: ProtectedMPI, }, EdDSA { scalar: ProtectedMPI, }, ECDSA { scalar: ProtectedMPI, }, ECDH { scalar: ProtectedMPI, }, Unknown { mpis: Box<[ProtectedMPI]>, rest: Protected, }, }
A secret key.
Provides a typed and structured way of storing multiple MPIs in
Key
packets. Secret key components are protected by storing
them using ProtectedMPI
.
Note: This enum cannot be exhaustively matched to allow future extensions.
Variants (Non-exhaustive)
RSA secret key.
Show fields
Fields of RSA
d: ProtectedMPI
Secret exponent, inverse of e in Phi(N).
p: ProtectedMPI
Smaller secret prime.
q: ProtectedMPI
Larger secret prime.
u: ProtectedMPI
Inverse of p mod q.
NIST DSA secret key.
Show fields
Fields of DSA
x: ProtectedMPI
Secret key log_g(y) in Zp.
ElGamal secret key.
Show fields
Fields of ElGamal
x: ProtectedMPI
Secret key log_g(y) in Zp.
DJBs “Twisted” Edwards curve DSA secret key.
Show fields
Fields of EdDSA
scalar: ProtectedMPI
Secret scalar.
NISTs Elliptic curve DSA secret key.
Show fields
Fields of ECDSA
scalar: ProtectedMPI
Secret scalar.
Elliptic curve ElGamal secret key.
Show fields
Fields of ECDH
scalar: ProtectedMPI
Secret scalar.
Unknown number of MPIs for an unknown algorithm.
Show fields
Fields of Unknown
mpis: Box<[ProtectedMPI]>
The successfully parsed MPIs.
rest: Protected
Any data that failed to parse.
Implementations
impl SecretKeyMaterial
[src]
impl SecretKeyMaterial
[src]pub fn algo(&self) -> Option<PublicKeyAlgorithm>
[src]
pub fn algo(&self) -> Option<PublicKeyAlgorithm>
[src]Returns, if known, the public-key algorithm for this secret key.
impl SecretKeyMaterial
[src]
impl SecretKeyMaterial
[src]pub fn parse_with_checksum<R: Read + Send + Sync>(
algo: PublicKeyAlgorithm,
reader: R,
checksum: SecretKeyChecksum
) -> Result<Self>
[src]
pub fn parse_with_checksum<R: Read + Send + Sync>(
algo: PublicKeyAlgorithm,
reader: R,
checksum: SecretKeyChecksum
) -> Result<Self>
[src]Parses secret key MPIs for algo
plus their SHA1 checksum.
Fails if the checksum is wrong.
pub fn parse<R: Read + Send + Sync>(
algo: PublicKeyAlgorithm,
reader: R
) -> Result<Self>
[src]
pub fn parse<R: Read + Send + Sync>(
algo: PublicKeyAlgorithm,
reader: R
) -> Result<Self>
[src]Parses a set of OpenPGP MPIs representing a secret key.
See Section 3.2 of RFC 4880 for details.
impl SecretKeyMaterial
[src]
impl SecretKeyMaterial
[src]pub fn serialize_with_checksum(
&self,
w: &mut dyn Write,
checksum: SecretKeyChecksum
) -> Result<()>
[src]
pub fn serialize_with_checksum(
&self,
w: &mut dyn Write,
checksum: SecretKeyChecksum
) -> Result<()>
[src]Writes this secret key with a checksum to w
.
Trait Implementations
impl Clone for SecretKeyMaterial
[src]
impl Clone for SecretKeyMaterial
[src]fn clone(&self) -> SecretKeyMaterial
[src]
fn clone(&self) -> SecretKeyMaterial
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for SecretKeyMaterial
[src]
impl Debug for SecretKeyMaterial
[src]impl From<SecretKeyMaterial> for SecretKeyMaterial
[src]
impl From<SecretKeyMaterial> for SecretKeyMaterial
[src]fn from(mpis: SecretKeyMaterial) -> Self
[src]
fn from(mpis: SecretKeyMaterial) -> Self
[src]Performs the conversion.
impl From<SecretKeyMaterial> for Unencrypted
[src]
impl From<SecretKeyMaterial> for Unencrypted
[src]fn from(mpis: SecretKeyMaterial) -> Self
[src]
fn from(mpis: SecretKeyMaterial) -> Self
[src]Performs the conversion.
impl Hash for SecretKeyMaterial
[src]
impl Hash for SecretKeyMaterial
[src]impl Hash for SecretKeyMaterial
[src]
impl Hash for SecretKeyMaterial
[src]impl Marshal for SecretKeyMaterial
[src]
impl Marshal for SecretKeyMaterial
[src]impl MarshalInto for SecretKeyMaterial
[src]
impl MarshalInto for SecretKeyMaterial
[src]impl Ord for SecretKeyMaterial
[src]
impl Ord for SecretKeyMaterial
[src]impl PartialEq<SecretKeyMaterial> for SecretKeyMaterial
[src]
impl PartialEq<SecretKeyMaterial> for SecretKeyMaterial
[src]impl PartialOrd<SecretKeyMaterial> for SecretKeyMaterial
[src]
impl PartialOrd<SecretKeyMaterial> for SecretKeyMaterial
[src]fn partial_cmp(&self, other: &SecretKeyMaterial) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &SecretKeyMaterial) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for SecretKeyMaterial
[src]
Auto Trait Implementations
impl RefUnwindSafe for SecretKeyMaterial
impl Send for SecretKeyMaterial
impl Sync for SecretKeyMaterial
impl Unpin for SecretKeyMaterial
impl UnwindSafe for SecretKeyMaterial
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more