[−][src]Enum sequoia_openpgp::crypto::mpi::SecretKeyMaterial
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.
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.
Fields of DSA
x: ProtectedMPI
Secret key log_g(y) in Zp.
ElGamal secret key.
Fields of ElGamal
x: ProtectedMPI
Secret key log_g(y) in Zp.
DJBs "Twisted" Edwards curve DSA secret key.
Fields of EdDSA
scalar: ProtectedMPI
Secret scalar.
NISTs Elliptic curve DSA secret key.
Fields of ECDSA
scalar: ProtectedMPI
Secret scalar.
Elliptic curve ElGamal secret key.
Fields of ECDH
scalar: ProtectedMPI
Secret scalar.
Unknown number of MPIs for an unknown algorithm.
Fields of Unknown
mpis: Box<[ProtectedMPI]>
The successfully parsed MPIs.
rest: Protected
Any data that failed to parse.
Implementations
impl SecretKeyMaterial
[src]
pub fn algo(&self) -> Option<PublicKeyAlgorithm>
[src]
Returns, if known, the public-key algorithm for this secret key.
impl SecretKeyMaterial
[src]
pub fn parse_with_checksum<R: Read + Send + Sync>(
algo: PublicKeyAlgorithm,
reader: R,
checksum: SecretKeyChecksum
) -> Result<Self>
[src]
algo: PublicKeyAlgorithm,
reader: R,
checksum: SecretKeyChecksum
) -> Result<Self>
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]
algo: PublicKeyAlgorithm,
reader: R
) -> Result<Self>
Parses a set of OpenPGP MPIs representing a secret key.
See Section 3.2 of RFC 4880 for details.
impl SecretKeyMaterial
[src]
pub fn serialize_with_checksum(
&self,
w: &mut dyn Write,
checksum: SecretKeyChecksum
) -> Result<()>
[src]
&self,
w: &mut dyn Write,
checksum: SecretKeyChecksum
) -> Result<()>
Writes this secret key with a checksum to w
.
Trait Implementations
impl Clone for SecretKeyMaterial
[src]
pub fn clone(&self) -> SecretKeyMaterial
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SecretKeyMaterial
[src]
impl Eq for SecretKeyMaterial
[src]
impl From<SecretKeyMaterial> for SecretKeyMaterial
[src]
pub fn from(mpis: SecretKeyMaterial) -> Self
[src]
impl From<SecretKeyMaterial> for Unencrypted
[src]
pub fn from(mpis: SecretKeyMaterial) -> Self
[src]
impl Hash for SecretKeyMaterial
[src]
impl Hash for SecretKeyMaterial
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Marshal for SecretKeyMaterial
[src]
pub fn serialize(&self, w: &mut dyn Write) -> Result<()>
[src]
pub fn export(&self, o: &mut dyn Write) -> Result<()>
[src]
impl MarshalInto for SecretKeyMaterial
[src]
pub fn serialized_len(&self) -> usize
[src]
pub fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
pub fn to_vec(&self) -> Result<Vec<u8>>
[src]
pub fn export_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
pub fn export_to_vec(&self) -> Result<Vec<u8>>
[src]
impl Ord for SecretKeyMaterial
[src]
pub fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<SecretKeyMaterial> for SecretKeyMaterial
[src]
pub fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<SecretKeyMaterial> for SecretKeyMaterial
[src]
pub fn partial_cmp(&self, other: &SecretKeyMaterial) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,