pub struct PublicKey(pub RsaPublicKey);Expand description
An RSA public key
Tuple Fields§
§0: RsaPublicKeyImplementations§
Source§impl PublicKey
impl PublicKey
pub fn to_der(&self) -> Result<Vec<u8>, Error>
pub fn from_der(der: &[u8]) -> Result<Self, Error>
pub fn to_pem(&self) -> Result<String, Error>
pub fn from_pem(pem: &str) -> Result<Self, Error>
pub fn to_spki(&self, options: Option<&Options>) -> Result<Vec<u8>, Error>
pub fn from_spki(spki: &[u8], _options: Option<&Options>) -> Result<Self, Error>
Sourcepub fn blind<R: CryptoRng + RngCore>(
&self,
rng: &mut R,
msg: impl AsRef<[u8]>,
randomize_message: bool,
options: &Options,
) -> Result<BlindingResult, Error>
pub fn blind<R: CryptoRng + RngCore>( &self, rng: &mut R, msg: impl AsRef<[u8]>, randomize_message: bool, options: &Options, ) -> Result<BlindingResult, Error>
Blind a message (after optional randomization) to be signed
Methods from Deref<Target = RsaPublicKey>§
pub const MIN_PUB_EXPONENT: u64 = 2u64
pub const MAX_PUB_EXPONENT: u64 = 8_589_934_591u64
pub const MAX_SIZE: usize = 4_096usize
Trait Implementations§
Source§impl AsRef<RsaPublicKey> for PublicKey
impl AsRef<RsaPublicKey> for PublicKey
Source§fn as_ref(&self) -> &RsaPublicKey
fn as_ref(&self) -> &RsaPublicKey
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<PublicKey> for RsaPublicKey
impl From<PublicKey> for RsaPublicKey
Source§impl From<RsaPublicKey> for PublicKey
impl From<RsaPublicKey> for PublicKey
Source§fn from(value: RsaPublicKey) -> Self
fn from(value: RsaPublicKey) -> Self
Converts to this type from the input type.
impl Eq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
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