pub struct Pkcs8SpkiKeyMaterial { /* private fields */ }Expand description
Common PKCS#8/SPKI key material shared by multiple fixture crates.
Implementations§
Source§impl Pkcs8SpkiKeyMaterial
impl Pkcs8SpkiKeyMaterial
Sourcepub 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
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.
Sourcepub fn private_key_pkcs8_der(&self) -> &[u8] ⓘ
pub fn private_key_pkcs8_der(&self) -> &[u8] ⓘ
PKCS#8 DER-encoded private key bytes.
Sourcepub fn private_key_pkcs8_pem(&self) -> &str
pub fn private_key_pkcs8_pem(&self) -> &str
PKCS#8 PEM-encoded private key.
Sourcepub fn public_key_spki_der(&self) -> &[u8] ⓘ
pub fn public_key_spki_der(&self) -> &[u8] ⓘ
SPKI DER-encoded public key bytes.
Sourcepub fn public_key_spki_pem(&self) -> &str
pub fn public_key_spki_pem(&self) -> &str
SPKI PEM-encoded public key.
Sourcepub fn write_private_key_pkcs8_pem(&self) -> Result<TempArtifact, Error>
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.
Sourcepub fn write_public_key_spki_pem(&self) -> Result<TempArtifact, Error>
pub fn write_public_key_spki_pem(&self) -> Result<TempArtifact, Error>
Write the SPKI PEM public key to a tempfile and return the handle.
Sourcepub fn private_key_pkcs8_pem_corrupt(&self, how: CorruptPem) -> String
pub fn private_key_pkcs8_pem_corrupt(&self, how: CorruptPem) -> String
Produce a corrupted variant of the PKCS#8 PEM.
Sourcepub fn private_key_pkcs8_pem_corrupt_deterministic(
&self,
variant: &str,
) -> String
pub fn private_key_pkcs8_pem_corrupt_deterministic( &self, variant: &str, ) -> String
Produce a deterministic corrupted PKCS#8 PEM using a variant string.
Sourcepub fn private_key_pkcs8_der_truncated(&self, len: usize) -> Vec<u8> ⓘ
pub fn private_key_pkcs8_der_truncated(&self, len: usize) -> Vec<u8> ⓘ
Produce a truncated variant of the PKCS#8 DER.
Trait Implementations§
Source§impl Clone for Pkcs8SpkiKeyMaterial
impl Clone for Pkcs8SpkiKeyMaterial
Source§fn clone(&self) -> Pkcs8SpkiKeyMaterial
fn clone(&self) -> Pkcs8SpkiKeyMaterial
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Pkcs8SpkiKeyMaterial
impl RefUnwindSafe for Pkcs8SpkiKeyMaterial
impl Send for Pkcs8SpkiKeyMaterial
impl Sync for Pkcs8SpkiKeyMaterial
impl Unpin for Pkcs8SpkiKeyMaterial
impl UnsafeUnpin for Pkcs8SpkiKeyMaterial
impl UnwindSafe for Pkcs8SpkiKeyMaterial
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