Skip to main content

RsaKey

Struct RsaKey 

Source
pub struct RsaKey(/* private fields */);
Expand description

RSA 签名密钥(PSS 与 PKCS#1 v1.5,按对端 offer 选择)。

Implementations§

Source§

impl RsaKey

Source

pub fn from_pkcs1_der(der: &[u8]) -> Result<Self, RustlsError>

由 PKCS#1 RSAPrivateKey DER 构造(含结构一致性校验)。

Source

pub fn from_pkcs8_der(der: &[u8]) -> Result<Self, RustlsError>

由 PKCS#8 PrivateKeyInfo DER 构造。

Trait Implementations§

Source§

impl Debug for RsaKey

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl SigningKey for RsaKey

Source§

fn choose_scheme(&self, offered: &[SignatureScheme]) -> Option<Box<dyn Signer>>

Choose a SignatureScheme from those offered. Read more
Source§

fn algorithm(&self) -> SignatureAlgorithm

What kind of key we have.
Source§

fn public_key(&self) -> Option<SubjectPublicKeyInfoDer<'_>>

Get the RFC 5280-compliant SubjectPublicKeyInfo (SPKI) of this SigningKey if available.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.