Skip to main content

Pkcs8SpkiKeyMaterial

Struct Pkcs8SpkiKeyMaterial 

Source
pub struct Pkcs8SpkiKeyMaterial { /* private fields */ }
Expand description

Common PKCS#8/SPKI key material shared by multiple fixture crates.

Implementations§

Source§

impl Pkcs8SpkiKeyMaterial

Source

pub fn new( pkcs8_der: impl Into<Arc<[u8]>>, pkcs8_pem: impl Into<String>, spki_der: impl Into<Arc<[u8]>>, spki_pem: impl Into<String>, ) -> Pkcs8SpkiKeyMaterial

Build a material container from PKCS#8 and SPKI forms.

Source

pub fn private_key_pkcs8_der(&self) -> &[u8]

PKCS#8 DER-encoded private key bytes.

Source

pub fn private_key_pkcs8_pem(&self) -> &str

PKCS#8 PEM-encoded private key.

Source

pub fn public_key_spki_der(&self) -> &[u8]

SPKI DER-encoded public key bytes.

Source

pub fn public_key_spki_pem(&self) -> &str

SPKI PEM-encoded public key.

Source

pub fn write_private_key_pkcs8_pem(&self) -> Result<TempArtifact, Error>

Write the PKCS#8 PEM private key to a tempfile and return the handle.

Source

pub fn write_public_key_spki_pem(&self) -> Result<TempArtifact, Error>

Write the SPKI PEM public key to a tempfile and return the handle.

Source

pub fn private_key_pkcs8_pem_corrupt(&self, how: CorruptPem) -> String

Produce a corrupted variant of the PKCS#8 PEM.

Source

pub fn private_key_pkcs8_pem_corrupt_deterministic( &self, variant: &str, ) -> String

Produce a deterministic corrupted PKCS#8 PEM using a variant string.

Source

pub fn private_key_pkcs8_der_truncated(&self, len: usize) -> Vec<u8>

Produce a truncated variant of the PKCS#8 DER.

Source

pub fn private_key_pkcs8_der_corrupt_deterministic( &self, variant: &str, ) -> Vec<u8>

Produce a deterministic corrupted PKCS#8 DER using a variant string.

Source

pub fn kid(&self) -> String

A stable key identifier derived from the SPKI bytes.

Trait Implementations§

Source§

impl Clone for Pkcs8SpkiKeyMaterial

Source§

fn clone(&self) -> Pkcs8SpkiKeyMaterial

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Pkcs8SpkiKeyMaterial

Source§

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

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

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

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V