Struct PrivatePkcs8KeyDer

struct PrivatePkcs8KeyDer<'a>(_)

A DER-encoded plaintext private key; as specified in PKCS#8/RFC 5958

PKCS#8 private keys are identified in PEM context as PRIVATE KEY and when stored in a file usually use a .pem or .key extension. For more on PEM files, refer to the crate documentation.

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

// load from a PEM file
PrivatePkcs8KeyDer::from_pem_file("tests/data/nistp256key.pkcs8.pem").unwrap();
PrivatePkcs8KeyDer::from_pem_file("tests/data/rsa1024.pkcs8.pem").unwrap();

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

Implementations

impl PrivatePkcs8KeyDer<'_>

fn clone_key(self: &Self) -> PrivatePkcs8KeyDer<'static>

Clone the private key to a 'static value

fn secret_pkcs8_der(self: &Self) -> &[u8]

Yield the DER-encoded bytes of the private key

impl Debug for PrivatePkcs8KeyDer<'_>

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

impl From for PrivatePkcs8KeyDer<'_>

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

impl Zeroize for PrivatePkcs8KeyDer<'static>

fn zeroize(self: &mut Self)

impl<'a> Eq for PrivatePkcs8KeyDer<'a>

impl<'a> Freeze for PrivatePkcs8KeyDer<'a>

impl<'a> From for PrivatePkcs8KeyDer<'a>

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

impl<'a> PartialEq for PrivatePkcs8KeyDer<'a>

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

impl<'a> RefUnwindSafe for PrivatePkcs8KeyDer<'a>

impl<'a> Send for PrivatePkcs8KeyDer<'a>

impl<'a> StructuralPartialEq for PrivatePkcs8KeyDer<'a>

impl<'a> Sync for PrivatePkcs8KeyDer<'a>

impl<'a> Unpin for PrivatePkcs8KeyDer<'a>

impl<'a> UnwindSafe for PrivatePkcs8KeyDer<'a>

impl<T> Any for PrivatePkcs8KeyDer<'a>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for PrivatePkcs8KeyDer<'a>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for PrivatePkcs8KeyDer<'a>

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

impl<T> From for PrivatePkcs8KeyDer<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> PemObject for PrivatePkcs8KeyDer<'a>

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

impl<T, U> Into for PrivatePkcs8KeyDer<'a>

fn into(self: 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 for PrivatePkcs8KeyDer<'a>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for PrivatePkcs8KeyDer<'a>

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