Struct PrivatePkcs1KeyDer

pub struct PrivatePkcs1KeyDer<'a>(/* private field */);

A DER-encoded plaintext RSA private key; as specified in PKCS#1/RFC 3447

RSA private keys are identified in PEM context as RSA PRIVATE KEY and when stored in a file usually use a .pem or .key extension.

# #[cfg(all(feature = "alloc", feature = "std"))] {
use rustls_pki_types::{PrivatePkcs1KeyDer, pem::PemObject};

// load from a PEM file
PrivatePkcs1KeyDer::from_pem_file("tests/data/rsa1024.pkcs1.pem").unwrap();

// or from a PEM byte slice...
# let byte_slice = include_bytes!("../tests/data/rsa1024.pkcs1.pem");
PrivatePkcs1KeyDer::from_pem_slice(byte_slice).unwrap();
# }

Implementations

impl PrivatePkcs1KeyDer<'_>

fn clone_key(&self) -> PrivatePkcs1KeyDer<'static>

Clone the private key to a 'static value

fn secret_pkcs1_der(&self) -> &[u8]

Yield the DER-encoded bytes of the private key

Trait Implementations

impl Debug for PrivatePkcs1KeyDer<'_>

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

impl From<Vec<u8>> for PrivatePkcs1KeyDer<'_>

fn from(vec: Vec<u8>) -> Self

impl Zeroize for PrivatePkcs1KeyDer<'static>

fn zeroize(&mut self)

impl<'a> Eq for PrivatePkcs1KeyDer<'a>

impl<'a> From<&'a [u8]> for PrivatePkcs1KeyDer<'a>

fn from(slice: &'a [u8]) -> Self

impl<'a> PartialEq for PrivatePkcs1KeyDer<'a>

fn eq(&self, other: &PrivatePkcs1KeyDer<'a>) -> bool

impl<'a> StructuralPartialEq for PrivatePkcs1KeyDer<'a>

Auto Trait Implementations

impl<'a> Freeze for PrivatePkcs1KeyDer<'a>

impl<'a> RefUnwindSafe for PrivatePkcs1KeyDer<'a>

impl<'a> Send for PrivatePkcs1KeyDer<'a>

impl<'a> Sync for PrivatePkcs1KeyDer<'a>

impl<'a> Unpin for PrivatePkcs1KeyDer<'a>

impl<'a> UnsafeUnpin for PrivatePkcs1KeyDer<'a>

impl<'a> UnwindSafe for PrivatePkcs1KeyDer<'a>

Blanket Implementations

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

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for PrivatePkcs1KeyDer<'a> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for PrivatePkcs1KeyDer<'a> where T: ?Sized,

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

impl<T> From<T> for PrivatePkcs1KeyDer<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> PemObject for PrivatePkcs1KeyDer<'a> where T: PemObjectFilter + From<Vec<u8>>,

fn from_pem(kind: SectionKind, der: Vec<u8>) -> Option<T>

impl<T, U> Into<U> for PrivatePkcs1KeyDer<'a> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom<U> for PrivatePkcs1KeyDer<'a> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for PrivatePkcs1KeyDer<'a> where U: TryFrom<T>,

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