Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,13 @@ impl RsaPrivateKey {
Self::from_components(n.get(), public_exponent, d, primes)
}

/// Get the public key from the private key.
///
/// Specific alternative to [`AsRef::as_ref`].
pub fn as_public_key(&self) -> &RsaPublicKey {
&self.pubkey_components
}

/// Get the public key from the private key, cloning `n` and `e`.
///
/// Generally this is not needed since `RsaPrivateKey` implements the `PublicKey` trait,
Expand Down